Python与Java、PyJNIus安装

2024-09-28 23:01:19 发布

您现在位置:Python中文网/ 问答频道 /正文

为了在Python中使用Java绑定,请安装以下内容: https://github.com/kivy/pyjnius

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

    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

Tags: installpybuildincluderecordexerunningamd64