首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python with Java,PyJNIus安装

Python with Java,PyJNIus安装
EN

Stack Overflow用户
提问于 2016-02-15 01:09:53
回答 1查看 1.1K关注 0票数 1

为了在Python中使用绑定的Java,我安装了以下程序:https://github.com/kivy/pyjnius

我得到了这个错误:它似乎试图将C++文件头编译成Java_HOME...,这看起来非常奇怪:

代码语言:javascript
复制
    Installing collected packages: jnius
      Running setup.py install for jnius
        Complete output from command D:\_devs\Python01\WinPython-64-2710\python-2.7.10.amd64\python.exe -c "import setuptools, tokenize;__file__='f:\\usertemp\\pip-build-wdmlwj\\jnius\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record f:\usertemp\pip-f_a0kd-record\install-record.txt --single-version-externally-managed --compile:
        running install
        running build
        running build_py
        running build_ext
        skipping 'jnius\jnius.c' Cython extension (up-to-date)
        building 'jnius' extension
        D:\_devs\Python01\WinPython-64-2710\python-2.7.10.amd64\Scripts\gcc.exe -mdll -O -Wall -IE:\_devs\JDK7\include -IE:\_devs\JDK7\include\linux -ID:\_devs\Python01\WinPython-64-2710\python-2.7.10.amd64\include -ID:\_devs\Python01\WinPython-64-2710\python-2.7.10.amd64\PC -c jnius\jnius.c -o build\temp.win-amd64-2.7\Release\jnius\jnius.o
        In file included from jnius\jnius.c:256:0:
        E:\_devs\JDK7\include/jni.h:45:20: fatal error: jni_md.h: No such file or directory
         #include "jni_md.h"
                            ^
        compilation terminated.
        error: command 'D:\\_devs\\Python01\\WinPython-64-2710\\python-2.7.10.amd64\\Scripts\\gcc.exe' failed with exit status 1
EN

回答 1

Stack Overflow用户

发布于 2020-09-16 09:34:24

好吧,基于这个错误,我认为在Windows操作系统中Python编译Jnius扩展所需的包的某些部分存在问题,老实说,在Windows中你会发现比Ubuntu更多的错误,我不知道为什么,我从Windows切换到Ubuntu,现在,编程变得更好、更容易了,但这里有一个解决方法:

在Ubuntu中,我知道做这件事的命令,但是在windows中,看看这里:https://preshing.com/20141108/how-to-install-the-latest-gcc-on-windows/

这里:https://solarianprogrammer.com/2019/11/05/install-gcc-windows/

我能给你的最好的建议是,安装最新的稳定的Ubuntu官方软件,没有必要卸载Windows你可以同时拥有Ubuntu和Windows

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35394594

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档