在 Windows 10 中设置 Python 路径以安装第三方 Python 包
Set Python Path in Windows 10 to Install Third-Party Python Packages
我的 IT 部门不允许我使用 pip 或 easy install 从 PyPi 安装 Python 库包。
在某些时候我发现我可以下载 Python 包,用 7-Zip 解压内容直到我暴露 setup.py 文件。然后通过在同一位置打开命令行,我可以输入
set path=%path%;C:\Python27\ArcGIS10.7\
和
python setup.py install
将库安装到我的 Python 目录中。这个技巧在 Windows 7.
上非常有效
我已经 'upgraded' 到 Windows 10. 当我尝试我的安装技巧时 Windows PowerShell returns this
PS C:\TEMP\simplekml-1.3.1> set path=%path%;C:\Python27\ArcGIS10.7\
C:\Python27\ArcGIS10.7\ : The term 'C:\Python27\ArcGIS10.7\' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:17
+ set path=%path%;C:\Python27\ArcGIS10.7\
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Python27\ArcGIS10.7\:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如何在 Windows 10 中安装这些 Python 软件包?
您可以像这样编辑环境变量:
$env:path = $env:path + ";C:\Python27\ArcGIS10.7\"
请事先检查$env:path
末尾是否有分号。
您可能无法在 C: 驱动器中设置环境路径或任何其他文件,最好在桌面上下载并解压缩 Python 文件并转到脚本并转到使用路径的命令提示符并尝试使用 PIP 安装,因为您可以完全控制桌面,无需询问权限。
我的 IT 部门不允许我使用 pip 或 easy install 从 PyPi 安装 Python 库包。
在某些时候我发现我可以下载 Python 包,用 7-Zip 解压内容直到我暴露 setup.py 文件。然后通过在同一位置打开命令行,我可以输入
set path=%path%;C:\Python27\ArcGIS10.7\
和
python setup.py install
将库安装到我的 Python 目录中。这个技巧在 Windows 7.
上非常有效我已经 'upgraded' 到 Windows 10. 当我尝试我的安装技巧时 Windows PowerShell returns this
PS C:\TEMP\simplekml-1.3.1> set path=%path%;C:\Python27\ArcGIS10.7\
C:\Python27\ArcGIS10.7\ : The term 'C:\Python27\ArcGIS10.7\' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:17
+ set path=%path%;C:\Python27\ArcGIS10.7\
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Python27\ArcGIS10.7\:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如何在 Windows 10 中安装这些 Python 软件包?
您可以像这样编辑环境变量:
$env:path = $env:path + ";C:\Python27\ArcGIS10.7\"
请事先检查$env:path
末尾是否有分号。
您可能无法在 C: 驱动器中设置环境路径或任何其他文件,最好在桌面上下载并解压缩 Python 文件并转到脚本并转到使用路径的命令提示符并尝试使用 PIP 安装,因为您可以完全控制桌面,无需询问权限。