我对python有点陌生,我使用pip通过控制台安装包。以前的安装工作得很好,但是当我尝试安装pyzmq时,我收到一条错误消息。我以为问题是由Cython引起的(因为我以前见过类似的东西),但后来我安装了Cython,问题就一直存在。这是我得到的全部信息:
Collecting pyzmq
Using cached https://files.pythonhosted.org/packages/7a/d2/1eb3a994374802b352d4911f3317313a5b4ea786bc830cc5e343dad9b06d/pyzmq-18.1.0.tar.gz
Building wheels for collected packages: pyzmq
Building wheel for pyzmq (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\gianf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gianf\\AppData\\Local\\Temp\\pip-install-7scmlplo\\pyzmq\\setup.py'"'"'; __file__='"'"'C:\\Users\\gianf\\AppData\\Local\\Temp\\pip-install-7scmlplo\\pyzmq\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\gianf\AppData\Local\Temp\pip-wheel-hxgsq9q7' --python-tag cp38
cwd: C:\Users\gianf\AppData\Local\Temp\pip-install-7scmlplo\pyzmq\
Complete output (191 lines):
running bdist_wheel
running build
running build_py
Generating grammar tables from C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\lib\lib2to3\Grammar.txt
Writing grammar tables to C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\lib\lib2to3\Grammar3.8.0.final.0.pickle
Writing failed: [Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\\lib\\lib2to3\\Grammar3.8.0.final.0.pickle'
Generating grammar tables from C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\lib\lib2to3\PatternGrammar.txt
Writing grammar tables to C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\lib\lib2to3\PatternGrammar3.8.0.final.0.pickle
Writing failed: [Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\\lib\\lib2to3\\PatternGrammar3.8.0.final.0.pickle'
creating build
(((copying / creating a bunch of stuff I omitted to fit on the post)))
copying zmq\utils\zmq_constants.h -> build\lib.win-amd64-3.8\zmq\utils
running build_ext
running configure
{'libraries': ['libzmq'], 'include_dirs': [], 'library_dirs': [], 'runtime_library_dirs': [], 'extra_link_args': []}
Warning: Couldn't find an acceptable libzmq on the system.
If you expected pyzmq to link against an installed libzmq, please check to make sure:
* You have a C compiler installed
* A development version of Python is installed (including headers)
* A development version of ZMQ >= 3.2 is installed (including headers)
* If ZMQ is not in a default location, supply the argument --zmq=<path>
* If you did recently install ZMQ to a default location,
try rebuilding the ld cache with `sudo ldconfig`
or specify zmq's location with `--zmq=/usr/local`
You can skip all this detection/waiting nonsense if you know
you want pyzmq to bundle libzmq as an extension by passing:
`--zmq=bundled`
I will now try to build libzmq as a Python extension
unless you interrupt me (^C) in the next 10 seconds...
************************************************
1...
Using bundled libzmq
already have bundled\zeromq
staging platform.hpp from: C:\Users\gianf\AppData\Local\Temp\pip-install-7scmlplo\pyzmq\buildutils\include_win32
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
************************************************
----------------------------------------
ERROR: Failed building wheel for pyzmq
Running setup.py clean for pyzmq
Failed to build pyzmq
Installing collected packages: pyzmq
Running setup.py install for pyzmq ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\gianf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gianf\\AppData\\Local\\Temp\\pip-install-7scmlplo\\pyzmq\\setup.py'"'"'; __file__='"'"'C:\\Users\\gianf\\AppData\\Local\\Temp\\pip-install-7scmlplo\\pyzmq\\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\gianf\AppData\Local\Temp\pip-record-7kjkoe_6\install-record.txt' --single-version-externally-managed --compile --user --prefix=
cwd: C:\Users\gianf\AppData\Local\Temp\pip-install-7scmlplo\pyzmq\
Complete output (193 lines):
running install
running build
running build_py
Generating grammar tables from C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\lib\lib2to3\Grammar.txt
Writing grammar tables to C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\lib\lib2to3\Grammar3.8.0.final.0.pickle
Writing failed: [Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\\lib\\lib2to3\\Grammar3.8.0.final.0.pickle'
Generating grammar tables from C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\lib\lib2to3\PatternGrammar.txt
Writing grammar tables to C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\lib\lib2to3\PatternGrammar3.8.0.final.0.pickle
Writing failed: [Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.240.0_x64__qbz5n2kfra8p0\\lib\\lib2to3\\PatternGrammar3.8.0.final.0.pickle'
(((copying / creating a bunch of lines I omitted to fit on the post)))
running build_ext
running configure
{'libraries': ['libzmq'], 'include_dirs': [], 'library_dirs': [], 'runtime_library_dirs': [], 'extra_link_args': []}
Warning: Couldn't find an acceptable libzmq on the system.
If you expected pyzmq to link against an installed libzmq, please check to make sure:
* You have a C compiler installed
* A development version of Python is installed (including headers)
* A development version of ZMQ >= 3.2 is installed (including headers)
* If ZMQ is not in a default location, supply the argument --zmq=<path>
* If you did recently install ZMQ to a default location,
try rebuilding the ld cache with `sudo ldconfig`
or specify zmq's location with `--zmq=/usr/local`
You can skip all this detection/waiting nonsense if you know
you want pyzmq to bundle libzmq as an extension by passing:
`--zmq=bundled`
I will now try to build libzmq as a Python extension
unless you interrupt me (^C) in the next 10 seconds...
1...
Using bundled libzmq
already have bundled\zeromq
already have platform.hpp
building 'zmq.libzmq' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\gianf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gianf\\AppData\\Local\\Temp\\pip-install-7scmlplo\\pyzmq\\setup.py'"'"'; __file__='"'"'C:\\Users\\gianf\\AppData\\Local\\Temp\\pip-install-7scmlplo\\pyzmq\\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\gianf\AppData\Local\Temp\pip-record-7kjkoe_6\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
<>因为我注意到了一个关于C++的错误,我基本上下载并安装了我能与微软Visual C++相关的所有东西,但是错误仍然存在。在还试图通过msi文件安装pyzmq,但我不确定正确的路径。在
我想出来了!在
我安装了visualstudio,但这还不够。我还需要构建工具,更具体地说,在安装期间,在可选包上有“C++”的所有内容。之后我就可以毫无问题地安装软件包了。在
相关问题 更多 >
编程相关推荐