Jnius安装bug,“无法确定JDK_HOME" [英] Jnius installation bug, "Unable to determine JDK_HOME"

查看:74
本文介绍了Jnius安装bug,“无法确定JDK_HOME"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过在 CMD 中键入pip install jnius"来安装 jnius Python 模块.这是我收到的消息:

I tried to install jnius Python module by typing 'pip install jnius' in CMD. This is the message I got:

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
 File "<string>", line 1, in <module>
 File "c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\setup.py", line 111, in <module>
    raise Exception('Unable to determine JDK_HOME')
Exception: Unable to determine JDK_HOME
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in 
 c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\

我重新启动了 CMD,但没有帮助.

I restarted CMD, but it didn't help.

推荐答案

我终于解决了.在这发生之前我已经安装了 Cython,并且在@Chris 评论之后我安装了 Java JDK 和 JRE.而且我还在系统变量中添加了JAVA_HOME和JDK_HOME.谢谢@Chris,但并没有完全解决问题.

I have finally resolved it. I have installed Cython before this happened and I installed both Java JDK and JRE after @Chris comment. And I have also added JAVA_HOME and JDK_HOME to system variables.Thank you @Chris, but it didn't resolve problem completely.

然后我收到了另一条错误消息.有人写道,我必须从此页面安装 Microsoft Visual C++ Compiler for Python 2.7:https://www.microsoft.com/en-us/下载/确认.aspx?id=44266

Then I got another error message. There was written that I have to install Microsoft Visual C++ Compiler for Python 2.7 from this page: https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

之后,我再次尝试安装 jnius,但错误消息说权限被拒绝,所以我以管理员身份运行 CMD,并通过键入 pip install jnius最终安装了 jnius.

After that I tried to install jnius again but the error message said that permission is denied so I ran CMD as administrator and finally installed jnius by typing pip install jnius.

我花了很多时间来解决它,希望它可以帮助每个遇到相同或类似问题的人.

I spent a lot of time to resolve it and hope that it will help everyone with same or similar problem.

这篇关于Jnius安装bug,“无法确定JDK_HOME"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆