简体   繁体   English

从 ZAEA23489CE3AA9B6406EBB28E0CDA3 手动安装 Python PIP package 时出现问题

[英]Issue installing Python PIP package manually from Windows Store installation

I'm running Python via the Windows Store installation and when I go to manually install a package, I get a long-winded message about using 'easy_install'. I'm running Python via the Windows Store installation and when I go to manually install a package, I get a long-winded message about using 'easy_install'. My version is Python 3.9.我的版本是 Python 3.9。 What's the best way to move forward?前进的最佳方式是什么?

python setup.py install

running install error: can't create or remove files in install directory运行安装错误:无法在安装目录中创建或删除文件

The following error occurred while trying to add or remove files in the installation directory:尝试在安装目录中添加或删除文件时发生以下错误:

 [Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\\Lib\\site-packages\\test-easy-install-7300.write-test'

The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:您指定的安装目录(通过 --install-dir、--prefix 或 distutils 默认设置)是:

 C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\

Perhaps your account does not have write access to this directory?也许您的帐户没有对该目录的写入权限? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account.如果安装目录是系统拥有的目录,您可能需要以管理员或“root”帐户登录。 If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable.如果您没有对这台机器的管理访问权限,您可能希望选择一个不同的安装目录,最好是 PYTHONPATH 环境变量中列出的一个。

For information on other options, you may wish to consult the documentation at:有关其他选项的信息,您可能希望在以下位置查阅文档:

https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html

Please make the appropriate changes for your system and try again.请对您的系统进行适当的更改,然后重试。

Step 1: Download PIP get-pip.py Before installing PIP, download the get-pip.py file.第 1 步:下载 PIP get-pip.py 在安装 PIP 之前,请下载 get-pip.py 文件。 https://bootstrap.pypa.io/get-pip.py https://bootstrap.pypa.io/get-pip.py

  1. Launch a command prompt if it isn't already open.如果尚未打开,请启动命令提示符。 To do so, open the Windows search bar, type cmd and click on the icon.为此,请打开 Windows 搜索栏,输入 cmd 并单击图标。

  2. Then, run the following command to download the get-pip.py file:然后,运行以下命令下载 get-pip.py 文件:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py Download PIP software package. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py Download PIP software package. Step 2: Installing PIP on Windows To install PIP type in the following:步骤 2:在 Windows 上安装 PIP 安装 PIP 类型如下:

python get-pip.py Install PIP on Windows. python get-pip.py 在 Windows 上安装 PIP。 If the file isn't found, double-check the path to the folder where you saved the file.如果未找到该文件,请仔细检查保存该文件的文件夹的路径。 You can view the contents of your current directory using the following command:您可以使用以下命令查看当前目录的内容:

dir The dir command returns a full listing of the contents of a directory. dir dir 命令返回目录内容的完整列表。

Step 3: Verify Installation Once you've installed PIP, you can test whether the installation has been successful by typing the following:第 3 步:验证安装 安装 PIP 后,您可以通过键入以下内容来测试安装是否成功:

pip help If PIP has been installed, the program runs, and you should see the location of the software package and a list of commands you can use with pip. pip help If PIP has been installed, the program runs, and you should see the location of the software package and a list of commands you can use with pip.

Run pip help command to verify installation.运行 pip 帮助命令来验证安装。 If you receive an error, repeat the installation process.如果收到错误,请重复安装过程。

Step 4: Add Pip to Windows Environment Variables To run PIP from any location, you need to add it to Windows environment variables to avoid getting the "not on PATH" error. Step 4: Add Pip to Windows Environment Variables To run PIP from any location, you need to add it to Windows environment variables to avoid getting the "not on PATH" error. To do so, follow the steps outlined below:为此,请按照下列步骤操作:

Open the System and Security window by searching for it in the Control Plane.通过在控制平面中搜索打开系统和安全 window。 Navigate to System settings.导航到系统设置。 Navigate to System settings in Windows.导航到 Windows 中的系统设置。 Then, select Advanced system settings.然后,select 高级系统设置。

Open the Environment Variables and double-click on the Path variable in the System Variables.打开环境变量并双击系统变量中的路径变量。

Next, select New and add the directory where you installed PIP.接下来,select 新建并添加您安装 PIP 的目录。 Click OK to save the changes.单击确定以保存更改。 Step 5: Configuration In Windows, the PIP configuration file is %HOME%\pip\pip.ini.第五步:配置在Windows中,PIP配置文件为%HOME%\pip\pip.ini。

There is also a legacy per-user configuration file.还有一个旧的每用户配置文件。 The file is located at %APPDATA%\pip\pip.ini.该文件位于 %APPDATA%\pip\pip.ini。

You can set a custom path location for this config file using the environment variable PIP_CONFIG_FILE.您可以使用环境变量 PIP_CONFIG_FILE 为该配置文件设置自定义路径位置。

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

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