[英]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'. 我的版本是 Python 3.9。 前进的最佳方式是什么?
python setup.py install
运行安装错误:无法在安装目录中创建或删除文件
尝试在安装目录中添加或删除文件时发生以下错误:
[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'
您指定的安装目录(通过 --install-dir、--prefix 或 distutils 默认设置)是:
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\
也许您的帐户没有对该目录的写入权限? 如果安装目录是系统拥有的目录,您可能需要以管理员或“root”帐户登录。 如果您没有对这台机器的管理访问权限,您可能希望选择一个不同的安装目录,最好是 PYTHONPATH 环境变量中列出的一个。
有关其他选项的信息,您可能希望在以下位置查阅文档:
https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html
请对您的系统进行适当的更改,然后重试。
第 1 步:下载 PIP get-pip.py 在安装 PIP 之前,请下载 get-pip.py 文件。 https://bootstrap.pypa.io/get-pip.py
如果尚未打开,请启动命令提示符。 为此,请打开 Windows 搜索栏,输入 cmd 并单击图标。
然后,运行以下命令下载 get-pip.py 文件:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py Download PIP software package. 步骤 2:在 Windows 上安装 PIP 安装 PIP 类型如下:
python get-pip.py 在 Windows 上安装 PIP。 如果未找到该文件,请仔细检查保存该文件的文件夹的路径。 您可以使用以下命令查看当前目录的内容:
dir dir 命令返回目录内容的完整列表。
第 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 帮助命令来验证安装。 如果收到错误,请重复安装过程。
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. 为此,请按照下列步骤操作:
通过在控制平面中搜索打开系统和安全 window。 导航到系统设置。 导航到 Windows 中的系统设置。 然后,select 高级系统设置。
打开环境变量并双击系统变量中的路径变量。
接下来,select 新建并添加您安装 PIP 的目录。 单击确定以保存更改。 第五步:配置在Windows中,PIP配置文件为%HOME%\pip\pip.ini。
还有一个旧的每用户配置文件。 该文件位于 %APPDATA%\pip\pip.ini。
您可以使用环境变量 PIP_CONFIG_FILE 为该配置文件设置自定义路径位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.