PyCharm 不会安装 gmpy2 - 已尝试所有版本
PyCharm won't install gmpy2 - Tried all versions
我正在尝试安装名为 gmpy2 的软件包,但 PyCharm 就是不会。尝试谷歌搜索但找不到任何对我有帮助的东西(或者我可能只是没有做对)。
我正在使用 Python 3.9 和 PyCharm。
这是 PyCharm 给我的错误弹出窗口及其内容的图片:
错误信息:
Collecting gmpy2
Using cached gmpy2-2.0.8.zip (280 kB)
Using legacy 'setup.py install' for gmpy2, since package 'wheel' is not installed.
Installing collected packages: gmpy2
Running setup.py install for gmpy2: started
Running setup.py install for gmpy2: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\chris\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\setup.py'"'"'; __file__='"'"'C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\chris\AppData\Local\Temp\pip-record-h157haka\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\chris\AppData\Roaming\Python\Python39\Include\gmpy2'
cwd: C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\
Complete output (12 lines):
running install
running build
running build_ext
building 'gmpy2' extension
creating build
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio19\Community\VC\Tools\MSVC.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMPIR -DWITHMPFR -DWITHMPC -IC:\Users\chris\AppData\Local\Programs\Python\Python39\include -IC:\Users\chris\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio19\Community\VC\Tools\MSVC.28.29910\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio19\Community\VC\Tools\MSVC.28.29910\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK.8\include\um -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\cppwinrt /Tcsrc\gmpy2.c /Fobuild\temp.win-amd64-3.9\Release\src\gmpy2.obj
gmpy2.c
C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\src\gmpy.h(104): fatal error C1083: Cannot open include file: 'mpir.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\chris\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\setup.py'"'"'; __file__='"'"'C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\chris\AppData\Local\Temp\pip-record-h157haka\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\chris\AppData\Roaming\Python\Python39\Include\gmpy2' Check the logs for full command output.
使用 conda 或 apt 或任何其他包管理器安装它。
我正在尝试安装名为 gmpy2 的软件包,但 PyCharm 就是不会。尝试谷歌搜索但找不到任何对我有帮助的东西(或者我可能只是没有做对)。
我正在使用 Python 3.9 和 PyCharm。
这是 PyCharm 给我的错误弹出窗口及其内容的图片:
错误信息:
Collecting gmpy2
Using cached gmpy2-2.0.8.zip (280 kB)
Using legacy 'setup.py install' for gmpy2, since package 'wheel' is not installed.
Installing collected packages: gmpy2
Running setup.py install for gmpy2: started
Running setup.py install for gmpy2: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\chris\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\setup.py'"'"'; __file__='"'"'C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\chris\AppData\Local\Temp\pip-record-h157haka\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\chris\AppData\Roaming\Python\Python39\Include\gmpy2'
cwd: C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\
Complete output (12 lines):
running install
running build
running build_ext
building 'gmpy2' extension
creating build
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio19\Community\VC\Tools\MSVC.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMPIR -DWITHMPFR -DWITHMPC -IC:\Users\chris\AppData\Local\Programs\Python\Python39\include -IC:\Users\chris\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio19\Community\VC\Tools\MSVC.28.29910\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio19\Community\VC\Tools\MSVC.28.29910\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK.8\include\um -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\include.0.19041.0\cppwinrt /Tcsrc\gmpy2.c /Fobuild\temp.win-amd64-3.9\Release\src\gmpy2.obj
gmpy2.c
C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\src\gmpy.h(104): fatal error C1083: Cannot open include file: 'mpir.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\chris\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\setup.py'"'"'; __file__='"'"'C:\Users\chris\AppData\Local\Temp\pip-install-ys292k4o\gmpy2_8475706ea077495daaefe9d081e1ffff\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\chris\AppData\Local\Temp\pip-record-h157haka\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\chris\AppData\Roaming\Python\Python39\Include\gmpy2' Check the logs for full command output.
使用 conda 或 apt 或任何其他包管理器安装它。