为什么我可以在Windows 10上安装带有PIP的Python软件包?

发布于 2025-02-10 08:07:02 字数 411 浏览 0 评论 0原文

自从我尝试升级它以来,我就在Windows 10 PC上与PIP进行了这场跑步战斗。我尝试使用pip升级升级它。之后,PIP停止工作。我想使用pip安装pygame在我的PC上安装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.

每当我尝试在PC上安装任何Python软件包时,我会收到相同的错误消息。请我做什么来纠正这个问题?

I have had this running battle with pip on my windows 10 PC ever since I tried to upgrade it. I tried to upgrade it with pip upgrade. After that, pip has stopped working. I wanted to install Pygame on my pc with pip install pygame and I got the following error message about my operating system:

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. Please what can I do to correct this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柒七 2025-02-17 08:07:02

只需键入您要使用用户许可执行的命令,如果您不想更改权限:

pip install pygame --user

如果要更改用户权限,请按照以下步骤操作:

只需 更改访问权限,其中特定软件包将安装。

Windows 10 上:

  • 转到安装文件夹。例如:c:\ program文件(x86)\ python37
  • 右键单击python安装root,然后单击properties。在这种情况下,python37文件夹。
  • 转到安全性选项卡,单击编辑按钮,并允许完全控制 用户组。请记住单击应用
  • 尝试再次安装软件包。

以下是所需设置的示例:

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:

  • Go to the installation folder. For example: C:\Program Files (x86)\Python37
  • Right click on python installation root and click Properties. In this case, the Python37 folder.
  • Go to the Security tab, click Edit button and allow full control for the Users group. Remember to click Apply.
  • Try to install the package again.

Below is an example of desired settings:
enter image description here

壹場煙雨 2025-02-17 08:07:02

解决方案#1

  1. 运行Windows PowerShell时,Admin
  2. 运行PIP安装命令以安装Python模块或升级PIP。

-----或----

解决方案#2

使用运行PIP安装 - 用户 frag

命令:python -m pip install-pip install-upgrade pip-用户

Solution #1

  1. Run Windows PowerShell as Admin
  2. Run the pip install command to install the python module or upgrade the pip.

---- OR ----

Solution #2

Run Pip Install with --user flag

Command: python -m pip install --upgrade pip --user

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文