cmd whlie在windows上安装CPPYY时出错



我一直在尝试在我的计算机上安装Cppyy,但我是新手,所以我对此了解不多。我的计算机上安装了python和pip

C:WINDOWSsystem32>python --version
Python 3.8.6
C:WINDOWSsystem32> pip --version
pip 20.2.3

当我尝试运行时

pip安装cppyy

cmd给我错误

ERROR: Command errored out with exit status 1:
command: 'C:UserssarfarazAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0python.exe' 'C:UserssarfarazAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0LocalCachelocal-packagesPython38site-packagespip' install --ignore-installed --no-user --prefix 'C:UserssarfarazAppDataLocalTemppip-build-env-z4gw8trboverlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'CPyCppyy==1.11.4; python_implementation != '"'"'PyPy'"'"'' 'cppyy-backend==1.14.0; python_implementation != '"'"'PyPy'"'"'' 'cppyy-cling==6.21.3; python_implementation != '"'"'PyPy'"'"'' 'cppyy-cling<=6.18.2.3; python_implementation == '"'"'PyPy'"'"'' setuptools wheel
cwd: None
Complete output (42 lines):
Ignoring cppyy-cling: markers 'platform_python_implementation == "PyPy"' don't match your environment
Collecting CPyCppyy==1.11.4
Using cached CPyCppyy-1.11.4.tar.gz (178 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:UserssarfarazAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0python.exe' 'C:UserssarfarazAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0LocalCachelocal-packagesPython38site-packagespip' install --ignore-installed --no-user --prefix 'C:UserssarfarazAppDataLocalTemppip-build-env-hj42_3n3overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cppyy-cling>=6.21.3' 'cppyy-backend>=1.14' setuptools wheel
cwd: None
Complete output (31 lines):
Collecting cppyy-cling>=6.21.3
Using cached cppyy_cling-6.21.3-py2.py3-none-win_amd64.whl (18.2 MB)
Collecting cppyy-backend>=1.14
Using cached cppyy-backend-1.14.0.tar.gz (32 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Collecting setuptools
Using cached setuptools-50.3.0-py3-none-any.whl (785 kB)
Collecting wheel
Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Building wheels for collected packages: cppyy-backend
Building wheel for cppyy-backend (PEP 517): started
Building wheel for cppyy-backend (PEP 517): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:UserssarfarazAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0python.exe' 'C:UserssarfarazAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0LocalCachelocal-packagesPython38site-packagespip_vendorpep517_in_process.py' build_wheel 'C:UserssarfarazAppDataLocalTemptmpojxb8d41'
cwd: C:UserssarfarazAppDataLocalTemppip-install-znkz3pmgcppyy-backend
Complete output (6 lines):
running bdist_wheel
running build
running build_ext
checking for buildtemp.win-amd64-3.8Release
creating buildtemp.win-amd64-3.8Release
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for cppyy-backend
Failed to build cppyy-backend
ERROR: Could not build wheels for cppyy-backend which use PEP 517 and cannot be installed directly
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:UserssarfarazAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0python.exe' 'C:UserssarfarazAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0LocalCachelocal-packagesPython38site-packagespip' install --ignore-installed --no-user --prefix 'C:UserssarfarazAppDataLocalTemppip-build-env-hj42_3n3overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cppyy-cling>=6.21.3' 'cppyy-backend>=1.14' setuptools wheel Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:UserssarfarazAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0python.exe' 'C:UserssarfarazAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0LocalCachelocal-packagesPython38site-packagespip' install --ignore-installed --no-user --prefix 'C:UserssarfarazAppDataLocalTemppip-build-env-z4gw8trboverlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'CPyCppyy==1.11.4; python_implementation != '"'"'PyPy'"'"'' 'cppyy-backend==1.14.0; python_implementation != '"'"'PyPy'"'"'' 'cppyy-cling==6.21.3; python_implementation != '"'"'PyPy'"'"'' 'cppyy-cling<=6.18.2.3; python_implementation == '"'"'PyPy'"'"'' setuptools wheel Check the logs for full command output.

我在网站上找到了一些说明,但我很难遵循,因为我是的新手

提前感谢

尝试升级setuptools wheel

pip install -U setuptools wheel

结束然后尝试

pip install cppyy --no-index

如果没有帮助,这个问题可能是由python 3.8PyPi支持的<3.7

如错误消息所示,hoefling已经提到过,您需要一个系统编译器,至少用于系统头,也用于C++库头。Cling需要这些头中的代码来解析您可能给它的任何使用C++标准库或Windows系统功能的新C++代码。

原则上,可以使用cppyy-cling发送预编译的标头,该标头包含作为IR位代码的所有系统和C++标头,但MSVC喜欢在不同版本之间更改标头包含保护,因此如果没有系统编译器,则只能工作。(它在Linux上稍微好一些,但在某些情况下也更改了包含保护名称。(一旦Cling在Windows上支持预编译模块(PCM;而不是头文件(,就会重新考虑这一点。然后,如果没有可用的系统编译器,这些PCM可以预先打包并有条件地安装。然而,上游的模块支持仍然非常新鲜,甚至还没有发布,所以这只会在中期出现。

不管怎样,微软风投现在是免费的。:(

最新更新