python安装jpype


代码:
virtualenv test
cd Script
activate
pip install jpype1
 
由于是新系统,会报错,所以需要修改源码需要先卸载
解决办法:1,不用jpype;2,修改源码(已经有人修改好)
 
第一步:
D:\pythonworkspace>pip uninstall Jpype1
Uninstalling JPype1-0.6.3:
  Would remove:
    c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\_jpype.cp37-win_amd64.pyd
    c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\jpype1-0.6.3.dist-info\*
    c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\jpype\*
    c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\jpypex\*
Proceed (y/n)? y
  Successfully uninstalled JPype1-0.6.3
 
D:\pythonworkspace>
 
 
 
第二步,下载:
 
 
第三步,安装
pip install JPype1-0.6.3-cp37-cp37m-win_amd64.whl
pip install numpy_quaternion-2018.8.13-cp37-cp37m-win_amd64.whl
 
第四步:新建项目,选择虚拟环境(上文提到的test环境)中的python
 
运行如下代码:
import jpype

jvmPath = jpype.getDefaultJVMPath()
jpype.startJVM(jvmPath)
jpype.java.lang.System.out.println("hello Hanlp!")
jpype.shutdownJVM()

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM