[英]Why can't I install python packages with pip on windows 10?
I have had this running battle with pip on my windows 10 PC ever since I tried to upgrade it.自从我尝试升级它以来,我一直在我的 Windows 10 PC 上与 pip 进行这场战斗。 I tried to upgrade it with
pip upgrade
.我尝试使用
pip upgrade
对其进行升级。 After that, pip has stopped working.之后,pip 停止工作。 I wanted to install Pygame on my pc with
pip install pygame
and I got the following error message about my operating system:我想用
pip install pygame
在我的电脑上安装 Pygame,我收到以下关于我的操作系统的错误消息:
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Python310\\Include\\pygame'
Consider using the `--user` option or check the permissions.
I get the same error message anytime I try to install any python package on my pc.每当我尝试在我的电脑上安装任何 python 包时,我都会收到相同的错误消息。 Please what can I do to correct this problem?
请问我能做些什么来纠正这个问题?
Solution #1解决方案#1
---- OR ---- - - 或者 - -
Solution #2解决方案#2
Run Pip Install with --user
flag使用
--user
标志运行 Pip 安装
Command: python -m pip install --upgrade pip --user
命令:
python -m pip install --upgrade pip --user
Just type the command you want execute with the user permission, if you don't want to change the permission:如果您不想更改权限,只需键入要使用用户权限执行的命令:
pip install pygame --user
and if you want to change user permission then follow these steps:如果您想更改用户权限,请按照以下步骤操作:
Just change the access permission , where the particular package is going to install.只需更改要安装特定软件包的访问权限即可。
On Windows 10 :在Windows 10上:
C:\Program Files (x86)\Python37
C:\Program Files (x86)\Python37
Properties
.Properties
。 In this case, the Python37
folder.Python37
文件夹。Security
tab, click Edit
button and allow full control for the Users group.Security
选项卡,单击Edit
按钮并允许对用户组进行完全控制。 Remember to click Apply
.Apply
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.