我想使用kivy和pycharm ide创建一个android应用程序。为此,我试图在pycharm中安装pyjnius。我正在使用python 3.6.4和Visual Studio2017。但这是它给的错误
error: command 'C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86
\\x86\\link.exe' failed with exit status 1120
这是详细的错误描述。
"Collecting pyjnius
Using cached
https://files.pythonhosted.org/packages/b6/57/c90acf31322e6417f06c90410dbfcb149633a6006b7efbf99dfebe177c1f/pyjnius-1.2.0.tar.gz 已经满足的要求:c:\ python36-32 \ lib \ site-packages中的六个> = 1.7.0(来自pyjnius)(1.12.0) 已满足要求:c:\ python36-32 \ lib \ site-packages中的cython(来自pyjnius)(0.29.6) 安装收集的软件包:pyjnius 为pyjnius运行setup.py install:已启动 为pyjnius运行setup.py install:状态为“错误” 来自命令C:\ Python36-32 \ python.exe -u -c的完整输出“导入setuptools,标记化; 文件 ='C:\ Users \ lenovo \ AppData \ Local \ Temp \ pycharm-packaging \ pyjnius \ setup.py'; f = getattr(tokenize,'open',open)(文件); code = f.read()。replace('\ r \ n','\ n'); f.close(); exec(compile(code, file ,'exec'))“ install --record C:\ Users \ lenovo \ AppData \ Local \ Temp \ pip- record-625zra8s \ install-record.txt-单个版本-外部管理-编译: C:\ Program Files \ Java \ jdk1.8.0_201 警告:无法将machine()= AMD64分配给cpu值! 使用cpu ='i386'代替! JDK_HOME:C:\ Program Files \ Java \ jdk1.8.0_201
JRE_HOME: C:\Program Files\Java\jdk1.8.0_201\jre
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
running install
running build
running build_py
creating build
creating build\lib.win32-3.6
copying jnius_config.py -> build\lib.win32-3.6
creating build\lib.win32-3.6\jnius
copying jnius\reflect.py -> build\lib.win32-3.6\jnius
copying jnius\signatures.py -> build\lib.win32-3.6\jnius
copying jnius\__init__.py -> build\lib.win32-3.6\jnius
creating build\lib.win32-3.6\jnius\src
creating build\lib.win32-3.6\jnius\src\org
creating build\lib.win32-3.6\jnius\src\org\jnius
copying jnius\src\org\jnius\NativeInvocationHandler.class -> build\lib.win32-3.6\jnius\src\org\jnius
copying jnius\src\org\jnius\NativeInvocationHandler.java -> build\lib.win32-3.6\jnius\src\org\jnius
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
cythoning jnius\jnius.pyx to jnius\jnius.c
C:\Python36-32\lib\site-packages\Cython\Compiler\Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\lenovo\AppData\Local\Temp\pycharm-packaging\pyjnius\jnius\jnius.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'jnius' extension
creating build\temp.win32-3.6
creating build\temp.win32-3.6\Release
creating build\temp.win32-3.6\Release\jnius
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Java\jdk1.8.0_201\include" "-IC:\Program Files\Java\jdk1.8.0_201\include\win32" -IC:\Python36-32\include -IC:\Python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcjnius\jnius.c /Fobuild\temp.win32-3.6\Release\jnius\jnius.obj
jnius.c
jnius\jnius.c(2434): warning C4273: 'JNI_CreateJavaVM': inconsistent dll linkage
C:\Program Files\Java\jdk1.8.0_201\include\jni.h(1938): note: see previous definition of 'JNI_CreateJavaVM'
jnius\jnius.c(4156): warning C4047: 'function': 'void **' differs in levels of indirection from 'JNIEnv **'
jnius\jnius.c(4156): warning C4022: 'function through pointer': pointer mismatch for actual parameter 2
jnius\jnius.c(8986): warning C4244: '=': conversion from 'long' to 'jchar', possible loss of data
jnius\jnius.c(11144): warning C4090: '=': different 'const' qualifiers
jnius\jnius.c(13756): warning C4244: '=': conversion from 'long' to 'jchar', possible loss of data
jnius\jnius.c(14594): warning C4244: '=': conversion from 'long' to 'jchar', possible loss of data
jnius\jnius.c(20842): warning C4047: '=': 'jobject' differs in levels of indirection from 'jobject *'
jnius\jnius.c(20851): warning C4047: '=': 'jobject' differs in levels of indirection from 'jclass *'
jnius\jnius.c(36010): warning C4090: '=': different 'const' qualifiers
jnius\jnius.c(36019): warning C4090: '=': different 'const' qualifiers
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:\Program Files\Java\jdk1.8.0_201\lib" "/LIBPATH:C:\Program Files\Java\jdk1.8.0_201\bin\server" /LIBPATH:C:\Python36-32\libs /LIBPATH:C:\Python36-32\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x86" jvm.lib /EXPORT:PyInit_jnius build\temp.win32-3.6\Release\jnius\jnius.obj /OUT:build\lib.win32-3.6\jnius\jnius.cp36-win32.pyd /IMPLIB:build\temp.win32-3.6\Release\jnius\jnius.cp36-win32.lib
Creating library build\temp.win32-3.6\Release\jnius\jnius.cp36-win32.lib and object build\temp.win32-3.6\Release\jnius\jnius.cp36-win32.exp
jnius.obj : error LNK2001: unresolved external symbol _JNI_CreateJavaVM@12
build\lib.win32-3.6\jnius\jnius.cp36-win32.pyd : fatal error LNK1120: 1 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120
----------------------------------------
命令“ C:\ Python36-32 \ python.exe -u -c”导入设置工具,标记化; 文件 ='C:\ Users \ lenovo \ AppData \ Local \ Temp \ pycharm- Packaging \ pyjnius \ setup.py'; f = getattr(tokenize,'open',open)( file ); code = f.read()。replace('\ r \ n',' \ n'); f.close(); exec(compile(code, file ,'exec'))“ install --record C:\ Users \ lenovo \ AppData \ Local \ Temp \ pip -record-625zra8s \ install-record.txt-“单一版本-外部管理-编译”失败,错误代码为1:C:\ Users \ lenovo \ AppData \ Local \ Temp \ pycharm-packaging \ pyjnius \ “
我也在高级系统设置中设置了环境变量。我不明白它实际上是在说什么。因为我对这种软件语言完全陌生。有人可以告诉我该怎么做吗?