File "/tmp/pip-build-PvzROe/pip/setup.py", line 7
时间: 2023-09-23 17:11:19 浏览: 92
这个错误通常是由于安装 pip 时使用的旧版本 setuptools 引起的。解决此问题的方法是升级 setuptools。
您可以按照以下步骤进行操作:
1. 首先,确保您正在使用最新版本的 pip:
```shell
pip install --upgrade pip
```
2. 然后,安装最新版本的 setuptools:
```shell
pip install --upgrade setuptools
```
3. 尝试重新安装您要安装的软件包:
```shell
pip install <package-name>
```
这些步骤应该可以解决该错误。如果问题仍然存在,请确保您的系统环境和依赖项都是正确的,并查看相关软件包的文档或寻求进一步的支持。
相关问题
Failed cleaning build dir for numpy Failed to build numpy Installing collected packages: numpy Running setup.py install for numpy ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-h5_vrlht/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-3koy23ws-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: Running from numpy source directory. Note: if you need reliable uninstall behavior, then install with pip instead of using `setup.py install`: - `pip install .` (from a git repo or downloaded source release) - `pip install numpy` (last NumPy release on PyPi) Cythonizing sources Error compiling Cython file: ------------------------------------------------------------ ... cdef sfc64_state rng_state def __init__(self, seed=None): BitGenerator.__init__(self, seed) self._bitgen.state = <void *>&self.rng_state self._bitgen.next_uint64 = &sfc64_uint64 ^ ------------------------------------------------------------ _sfc64.pyx:90:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil' numpy/random/_bounded_integers.pxd.in has not changed Processing numpy/random/_sfc64.pyx Traceback (most recent call last): File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 235, in <module> main() File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 231, in main find_process_files(root_dir) File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 222, in find_process_files process(root_dir, fromfile, tofile, function, hash_db) File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 188, in process processor_function(fromfile, tofile) File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 78, in process_pyx [sys.executable, '-m', 'cython'] + flags + ["-o", tofile, fromfile]) File "/usr/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'cython', '-3', '--fast-fail', '-o', '_sfc64.c', '_sfc64.pyx']' returned non-zero exit status 1. Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-h5_vrlht/numpy/setup.py", line 508, in <module> setup_package() File "/tmp/pip-build-h5_vrlht/numpy/setup.py", line 488, in setup_package generate_cython() File "/tmp/pip-build-h5_vrlht/numpy/setup.py", line 285, in generate_cython raise RuntimeError("Running cythonize failed!") RuntimeError: Running cythonize failed! ---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-h5_vrlht/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-3koy23ws-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-h5_vrlht/numpy/
您遇到了安装numpy时的错误。根据错误日志,问题出现在运行Cython编译器时。这可能是由于Cython版本不兼容或其他配置问题导致的。
您可以尝试以下解决方案:
1. 确保您使用的是最新版本的pip和setuptools。可以运行以下命令进行升级:
```
pip install --upgrade pip setuptools
```
2. 确保您的系统已安装Cython。您可以尝试通过运行以下命令来安装Cython:
```
pip install Cython
```
3. 如果您已经安装了Cython,并且问题仍然存在,请尝试降级Cython版本。运行以下命令:
```
pip install Cython==0.29.21
```
然后再次尝试安装numpy。
希望这些解决方案可以帮助您解决问题。如果问题仍然存在,请提供更多详细信息,以便我可以更好地帮助您。
nd for pyqt5== (env) [root@host-10-180-209-45 ~]# pip install pyqt5==5.15.0 -i https://pypi.douban.com/simple Looking in indexes: https://pypi.douban.com/simple Collecting pyqt5==5.15.0 Downloading https://pypi.doubanio.com/packages/8c/90/82c62bbbadcca98e8c6fa84f1a638de1ed1c89e85368241e9cc43fcbc320/PyQt5-5.15.0.tar.gz (3.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 2.5 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [22 lines of output] Traceback (most recent call last): File "/root/python/env/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/root/python/env/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/root/python/env/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel whl_basename = backend.build_wheel(metadata_directory, config_settings) File "/tmp/pip-build-env-uzsc1n8a/overlay/lib64/python3.8/site-packages/sipbuild/api.py", line 46, in build_wheel project = AbstractProject.bootstrap('wheel', File "/tmp/pip-build-env-uzsc1n8a/overlay/lib64/python3.8/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap project.setup(pyproject, tool, tool_description) File "/tmp/pip-build-env-uzsc1n8a/overlay/lib64/python3.8/site-packages/sipbuild/project.py", line 586, in setup self.apply_user_defaults(tool) File "project.py", line 62, in apply_user_defaults super().apply_user_defaults(tool) File "/tmp/pip-build-env-uzsc1n8a/overlay/lib/python3.8/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults super().apply_user_defaults(tool) File "/tmp/pip-build-env-uzsc1n8a/overlay/lib64/python3.8/site-packages/sipbuild/project.py", line 237, in apply_user_defaults self.builder.apply_user_defaults(tool) File "/tmp/pip-build-env-uzsc1n8a/overlay/lib/python3.8/site-packages/pyqtbuild/builder.py", line 69, in apply_user_defaults raise PyProjectOptionException('qmake', sipbuild.pyproject.PyProjectOptionException [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip.
这个错误可能是由于 pyqt5==5.15.0 的构建要求问题导致的。建议检查一下相关要求是否正确,并确保已安装必要的构建依赖项。另外,也可以尝试更新 pip 版本,然后再次运行安装命令。需要注意的是,这个问题不是由 pip 引起的,而是由这个包本身引起的。如果问题仍然存在,请尝试联系包的开发人员获取更多帮助。
阅读全文