安装python-bioformats时,python setup.py egg_info失败

时间:2017-03-30 19:23:43

标签: java python

我正在研究Ubuntu 16.04,我已经安装了virtualenvs。我在一个env并尝试安装python-bioformats 官方website的安装说明只是表示安装为:

pip install python-bioformats

我做了但是我收到以下错误消息:

(env2) daniel@Caenor:~/Envs$ pip install python-bioformats
Collecting python-bioformats
  Using cached python-bioformats-1.1.0.tar.gz
Collecting javabridge>=1.0 (from python-bioformats)
  Using cached javabridge-1.0.14.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-SUD0_e/javabridge/setup.py", line 375, in <module>
        ext_modules=ext_modules(),
      File "/tmp/pip-build-SUD0_e/javabridge/setup.py", line 93, in ext_modules
        java_home = find_javahome()
      File "/tmp/pip-build-SUD0_e/javabridge/javabridge/locate.py", line 73, in find_javahome
        java_bin = get_out(["bash", "-c", "type -p java"])
      File "/tmp/pip-build-SUD0_e/javabridge/javabridge/locate.py", line 70, in get_out
        raise Exception("Error finding javahome on linux: %s" % cmd)
    Exception: Error finding javahome on linux: ['bash', '-c', 'type -p java']

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-SUD0_e/javabridge/

我认为这意味着我需要javabridge。我试图安装,但我也收到错误:

(env2) daniel@Caenor:~$ pip install javabridge
Collecting javabridge
  Using cached javabridge-1.0.14.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-KrBfqr/javabridge/setup.py", line 375, in <module>
        ext_modules=ext_modules(),
      File "/tmp/pip-build-KrBfqr/javabridge/setup.py", line 93, in ext_modules
        java_home = find_javahome()
      File "/tmp/pip-build-KrBfqr/javabridge/javabridge/locate.py", line 73, in find_javahome
        java_bin = get_out(["bash", "-c", "type -p java"])
      File "/tmp/pip-build-KrBfqr/javabridge/javabridge/locate.py", line 70, in get_out
        raise Exception("Error finding javahome on linux: %s" % cmd)
    Exception: Error finding javahome on linux: ['bash', '-c', 'type -p java']

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-KrBfqr/javabridge/

documentation安装javabridge我需要numpy(我已经拥有),Java Development Kit(JDK)和C编译器。

我已经安装了JPype1(我认为这是JDK) 我试图安装Javabridge,但我又得到了错误。

要安装Javabridge和python-bioformats需要什么?

1 个答案:

答案 0 :(得分:1)

问题是你已经安装了Java注释。您需要在系统上安装Java。如果您认为它已安装,那么确定它不在Linux的搜索可执行文件的路径上,您需要将Java路径添加到环境变量PATH。每当你安装Java并添加到Linux PATH然后在命令行执行type -p java时它就会返回java可执行文件的路径。