ubuntu上的PIP安装错误20.04- [ERRNO 13]拒绝了权限:'/var/www/flask-prod/flask-prod/flask-prod-venv/lib/python3.8/site-packages/zipp.py&unp.py'
我正在尝试将软件包安装到Ubuntu 20.04上的虚拟环境中。我有sudo访问权限,但已经阅读了与sudo一起安装的不良习惯,所以我试图安装到VENV中。
我已经激活了VENV:(flask-prod-venv)iamurray@sjc45d1cetap001:/ var/var/www/www/flask-prod $
,但是当我运行pip3 install install flask
时,我获取以下内容:
Collecting flask
Using cached Flask-2.1.2-py3-none-any.whl (95 kB)
Collecting importlib-metadata>=3.6.0
Using cached importlib_metadata-4.11.4-py3-none-any.whl (18 kB)
Collecting click>=8.0
Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting Jinja2>=3.0
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting Werkzeug>=2.0
Using cached Werkzeug-2.1.2-py3-none-any.whl (224 kB)
Collecting itsdangerous>=2.0
Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting zipp>=0.5
Using cached zipp-3.8.0-py3-none-any.whl (5.4 kB)
Collecting MarkupSafe>=2.0
Using cached MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Installing collected packages: zipp, Werkzeug, MarkupSafe, itsdangerous, click, Jinja2, importlib-metadata, flask
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/var/www/flask-prod/flask-prod-venv/lib/python3.8/site-packages/zipp.py'
Check the permissions.
然后我去检查似乎是问题的zipp.py
文件的权限,但我找不到它:
(flask-prod-venv) iamurray@sjc45d1cetap001:/var/www/flask-prod/flask-prod-venv/lib/python3.8/site-packages$ ls -a
. _distutils_hack Flask pip-22.1.2.dist-info pkg_resources setuptools-62.3.4.dist-info _virtualenv.pth wheel wheel-0.37.1.virtualenv
.. distutils-precedence.pth pip pip-22.1.2.virtualenv setuptools setuptools-62.3.4.virtualenv _virtualenv.py wheel-0.37.1.dist-info
尝试仅更改权限会产生错误(这使得基于上述输出中缺少zipp.py的意义)
(flask-prod-venv) iamurray@sjc45d1cetap001:/var/www/flask-prod/flask-prod-venv/lib/python3.8/site-packages$ chmod 777 zipp.py
chmod: cannot access 'zipp.py': No such file or directory
有人可以帮助我将软件包安装到这个虚拟环境中吗?我正在尝试使用WSGI设置Apache服务器。谢谢你!
I am trying to install packages into a virtual environment on Ubuntu 20.04. I have sudo access but have read it is bad practice to pip install
with sudo, so I am trying to install into the venv.
I have activated the venv: (flask-prod-venv) iamurray@sjc45d1cetap001:/var/www/flask-prod$
, but when I run pip3 install flask
, I get the following:
Collecting flask
Using cached Flask-2.1.2-py3-none-any.whl (95 kB)
Collecting importlib-metadata>=3.6.0
Using cached importlib_metadata-4.11.4-py3-none-any.whl (18 kB)
Collecting click>=8.0
Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting Jinja2>=3.0
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting Werkzeug>=2.0
Using cached Werkzeug-2.1.2-py3-none-any.whl (224 kB)
Collecting itsdangerous>=2.0
Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting zipp>=0.5
Using cached zipp-3.8.0-py3-none-any.whl (5.4 kB)
Collecting MarkupSafe>=2.0
Using cached MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Installing collected packages: zipp, Werkzeug, MarkupSafe, itsdangerous, click, Jinja2, importlib-metadata, flask
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/var/www/flask-prod/flask-prod-venv/lib/python3.8/site-packages/zipp.py'
Check the permissions.
Then I go to check the permissions of this zipp.py
file that appears to be the issue, but I can't find it:
(flask-prod-venv) iamurray@sjc45d1cetap001:/var/www/flask-prod/flask-prod-venv/lib/python3.8/site-packages$ ls -a
. _distutils_hack Flask pip-22.1.2.dist-info pkg_resources setuptools-62.3.4.dist-info _virtualenv.pth wheel wheel-0.37.1.virtualenv
.. distutils-precedence.pth pip pip-22.1.2.virtualenv setuptools setuptools-62.3.4.virtualenv _virtualenv.py wheel-0.37.1.dist-info
Trying to just change permissions produces an error (that makes sense based on the absence of zipp.py in the above output)
(flask-prod-venv) iamurray@sjc45d1cetap001:/var/www/flask-prod/flask-prod-venv/lib/python3.8/site-packages$ chmod 777 zipp.py
chmod: cannot access 'zipp.py': No such file or directory
Could someone please help me install packages into this virtual environment? I am trying to set up an apache server with WSGI. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论