我尝试在Arch Linux上运行pip install flask,但得到以下错误:
Collecting itsdangerous>=0.24 (from flask)
Using cached https://files.pythonhosted.org/packages/dc/b4/a60bcdba945c00f6d608d8975131ab3f25b22f2bcfe1dab221165194b2d4/itsdangerous-0.24.tar.gz
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10->flask)
Using cached https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz
Installing collected packages: Werkzeug, click, MarkupSafe, Jinja2, itsdangerous, flask
Running setup.py install for MarkupSafe ... done
Running setup.py install for itsdangerous ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9u23zlnf/itsdangerous/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-r51zrnnv-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying itsdangerous.py -> build/lib
running install_lib
copying build/lib/itsdangerous.py -> /usr/lib/python3.6/site-packages
byte-compiling /usr/lib/python3.6/site-packages/itsdangerous.py to itsdangerous.cpython-36.pyc
error: [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages/__pycache__/itsdangerous.cpython-36.pyc.140591598548528'
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9u23zlnf/itsdangerous/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-r51zrnnv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9u23zlnf/itsdangerous/
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.`这个错误是什么意思?
发布于 2018-05-22 20:53:06
使用
pip install --user flask而不是。
您将收到权限被拒绝的错误,这意味着您没有权限写入特定位置。
当您使用pip install flask时,pip会尝试将flask包安装在/usr/lib/python3.6/../中的某个位置。这个目录需要根用户访问权限,这是您在运行pip install flask时所没有的权限。
通过使用--user标志,您告诉pip将软件包安装到不需要根权限的主目录中。
使用--user标志安装Python包始终是一种很好的实践,因为您不是在系统范围内安装该包。当您使用sudo pip install package_name时,您就是在系统范围内安装/升级一个包(带有依赖项)。在某些系统中,Python会给关键系统组件加电,迫使系统安装新版本的软件包可能会破坏一些关键系统组件。通常,系统坚持使用特定的包版本只是为了支持向后兼容性,如果您试图将其安装为sudo,则可能会破坏这一点。
发布于 2021-07-10 04:33:15
错误:无法执行'--user‘安装。用户站点-包在此虚拟环境中不可见。
https://stackoverflow.com/questions/50468202
复制相似问题