无法 pip 安装 javabridge

Ubuntu 18.04,蟒蛇 2.7


我试试


sudo pip install javabridge

我得到


      Complete output from command python setup.py egg_info:

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/pip-install-voWMrv/javabridge/setup.py", line 396, in <module>

    ext_modules=ext_modules(),

  File "/tmp/pip-install-voWMrv/javabridge/setup.py", line 131, in ext_modules

    library_dirs = [os.path.dirname(jvm_so)]

  File "/usr/lib/python2.7/posixpath.py", line 122, in dirname

    i = p.rfind('/') + 1

AttributeError: 'NoneType' object has no attribute 'rfind'


----------------------------------------

命令“python setup.py egg_info”在 /tmp/pip-install-voWMrv/javabridge/ 中失败,错误代码为 1


我能够做到


sudo pip install javabridge==1.0.16

但事实证明我需要最新的 1.0.17,为此我仍然收到上述错误。


这个命令


find /usr/lib/jvm/java-11-openjdk-amd64 -type f -name "*jvm.so"


/usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so

然后我跑了


JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

~$ JDK_HOME=/usr/lib/jvm/java-11-openjdk-amd64

最后


sudo pip install javabridge --user myName

给出同样的错误


Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/tmp/pip-install-i61jKx/javabridge/setup.py", line 396, in <module>

        ext_modules=ext_modules(),

      File "/tmp/pip-install-i61jKx/javabridge/setup.py", line 131, in ext_modules

        library_dirs = [os.path.dirname(jvm_so)]

      File "/usr/lib/python2.7/posixpath.py", line 122, in dirname

        i = p.rfind('/') + 1

    AttributeError: 'NoneType' object has no attribute 'rfind'

我也试过


JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 JDK_HOME=/usr/lib/jvm/java-11-openjdk-amd64 pip install javabridge --user



开心每一天1111
浏览 261回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java