【问题标题】:Heroku deployment - java_home not found for javabridge package NOT on requirements.txtHeroku 部署 - 未在 requirements.txt 上找到 javabridge 包的 java_home
【发布时间】:2021-01-05 01:25:17
【问题描述】:

我正在运行 git push heroku master 将我的第一个应用程序部署到 heroku。我遇到了与依赖项有关的各种错误,因此在遵循此处的建议后: Heroku Upload - Could not find a version that satisfies the requirement anaconda-client==1.4.0 我从 requiremets.txt 文件中删除了所有“有问题的”包。其中一个包是 python-javabridge。

然而,一旦到达终点,它仍在尝试安装 python-javabridge,出现以下错误:

remote:        Collecting zope.interface
remote:          Downloading zope.interface-5.2.0-cp36-cp36m-manylinux2010_x86_64.whl (236 kB)
remote:        Collecting contextvars; python_version < "3.7"
remote:          Downloading contextvars-2.4.tar.gz (9.6 kB)
remote:        Collecting mccabe<0.7.0,>=0.6.0
remote:          Downloading mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB)
remote:        Collecting jupyterlab-widgets>=1.0.0; python_version >= "3.5"
remote:          Downloading jupyterlab_widgets-1.0.0-py3-none-any.whl (243 kB)
remote:        Collecting jupyter-server~=1.1
remote:          Downloading jupyter_server-1.1.4-py3-none-any.whl (184 kB)
remote:        Collecting SecretStorage>=3.2; sys_platform == "linux"
remote:          Downloading SecretStorage-3.3.0-py3-none-any.whl (14 kB)
remote:        Collecting jeepney>=0.4.2; sys_platform == "linux"
remote:          Downloading jeepney-0.6.0-py3-none-any.whl (45 kB)
remote:        Collecting importlib-resources; python_version < "3.7"
remote:          Downloading importlib_resources-4.1.1-py3-none-any.whl (22 kB)
remote:        Collecting python-javabridge==4.0.0
remote:          Downloading python-javabridge-4.0.0.tar.gz (1.3 MB)
remote:            ERROR: Command errored out with exit status 1:
remote:             command: /app/.heroku/python/bin/python -c 'import sys, setuptools,
tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e55bn7p7/python-javabridge/setup.py'"'"';
__file__='"'"'/tmp/pip-install-e55bn7p7/python-javabridge/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-s9wk10ch
remote:                 cwd: /tmp/pip-install-e55bn7p7/python-javabridge/
remote:            Complete output (11 lines):
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-install-e55bn7p7/python-javabridge/setup.py", line 412, in <module>
remote:                ext_modules=ext_modules(),
remote:              File "/tmp/pip-install-e55bn7p7/python-javabridge/setup.py", line 96, in ext_modules
remote:                java_home = find_javahome()
remote:              File "/tmp/pip-install-e55bn7p7/python-javabridge/javabridge/locate.py", line 133, in find_javahome
remote:                java_bin = get_out(["bash", "-c", "type -p java"])
remote:              File "/tmp/pip-install-e55bn7p7/python-javabridge/javabridge/locate.py", line 130, in get_out
remote:                raise Exception("Error finding javahome on linux: %s" % cmd)
remote:            Exception: Error finding javahome on linux: ['bash', '-c', 'type -p java']
remote:            ----------------------------------------
remote:        ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to ...
remote:

在开始之前,我使用 conda update --all 更新了所有软件包。我正在使用 Windows 10 64 位。蟒蛇。蟒蛇 3.7。 Spyder 4.2.0 IDE。用于命令的 Spyder 终端。如何从我的 Windows 机器上修复这个 Linux 环境变量问题,或者如何让它根本不安装 javabridge? 提前致谢!

【问题讨论】:

    标签: heroku plotly-dash


    【解决方案1】:

    我遇到了类似的问题,但使用了不同的库(pyspark 和更多 2 个 ipython-something)。

    我找到的更简单的解决方案是从 requirements.txt 中删除这个库;

    应用程序是否依赖于这个库?您是否尝试删除此库?

    有时,安装它只是因为您使用 conda 安装了一些库。

    【讨论】:

    • 感谢@Leonardo Ferreira,我已经从需求列表中删除了 python-javabridge 以及其他一些包,因为它们都出错了。然而,在捆绑了软件包列表之后,它又回到想要安装 javabridge (谁知道之后还有什么......):(
    • 您是否尝试过使用 pip 而不是 conda 从头开始​​安装所有库?你能提供更多关于你的申请的信息吗?它是一个 jupyter notebook 还是一个 .py 文件?
    • 我已经用 pip install 安装了所有这些(我更喜欢 conda)。然后我按照论坛中的说明使用 conda 更新所有这些,所以我这样做了。该应用程序是一个 .py 文件,一个 plotly-dash 应用程序。我不确定它真的需要java,所以很困惑为什么它一直坚持安装它。这很令人沮丧,因为我在网上找不到这样的东西,而且我的时间不多了:(
    猜你喜欢
    • 2017-07-11
    • 2017-01-20
    • 1970-01-01
    • 2018-09-11
    • 2020-01-04
    • 1970-01-01
    • 1970-01-01
    • 2019-09-05
    • 1970-01-01
    相关资源
    最近更新 更多