简体   繁体   English

如何使用 pip 运行 requirements.txt 文件?

[英]how to run requirement.txt file using pip?

I try to run an python project.我尝试运行 python 项目。 So I created python virtual environment于是我创建了 python 虚拟环境

sudo python3 -m venv env

After this I activate environment在此之后我激活环境

source env/bin/activate

after this I try to install requirement from requirement.txt file using在此之后,我尝试使用 require.txt 文件安装需求

pip install -r requirements.txt

but It show an error但它显示一个错误

ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/var/www/html/selenium/env/lib/python3.8/site-packages/async_generator-1.10.dist-info'

Consider using the --user option or check the permissions.考虑使用--user选项或检查权限。

Don't create the environment with sudo since it will be owned by root.不要使用sudo创建环境,因为它将归 root 所有。 You don't need sudo because you should create the environment in a place you have access to.您不需要sudo ,因为您应该在可以访问的地方创建环境。 Preferably somewhere in your user/home directory (depending on OS).最好在您的用户/主目录中的某个位置(取决于操作系统)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM