pip - 如何在命令 pip install Cython 期间修复错误
问题描述
当我尝试安装 cython 时,您知道如何解决以下错误吗?
PermissionError:[Errno 13] 权限被拒绝:'/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/cython.py'
[namesurname@machine cmake-3.20.0]$ pip install Cython
Collecting Cython
Using cached https://files.pythonhosted.org/packages/d7/04/5890b30102782a3ec9970df3c10f024298803d89624ee23cf75d09bd2548/Cython-0.29.24-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: Cython
Exception:
Traceback (most recent call last):
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pip/commands/install.py", line 351, in run
strip_file_prefix=options.strip_file_prefix,
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 854, in install
strip_file_prefix=strip_file_prefix
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 1069, in move_wheel_files
strip_file_prefix=strip_file_prefix,
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/cython.py'
You are using pip version 9.0.1, however version 21.1.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[namesurname@machine cmake-3.20.0]$
如果没有适合此类问题的论坛,请告诉我一个合适的论坛!
解决方案
使用$ pip install cython --user
. 更好的是,使用 virtualenv。永远不会做sudo pip install
推荐阅读
- flutter - 来自 URL 的颤振图像仅适用于模拟器,但不适用于物理设备
- c++ - SDL_Init_Everything 在 C 中失败
- networkx - OSMNX/networkx 投影断开节点
- vba - 以不同的设置时间间隔运行多个宏 vba 通过按钮开始 - 按钮停止
- ios - iOS:仪器挂起模拟器的应用程序启动模板
- shell - 使用带数字后缀的 awk 将大文件拆分为较小的文件
- webpack - 如何在没有端口的情况下在 localhost 上运行 webpack-dev-server
- coq - 引入假设然后立即对其执行另一种策略的策略
- reactjs - NextJs与动态路由——空参数场景如何处理?
- android - 无法在片段 [Android] 中将项目添加到我的 ListView