python解释器 与 pip脚本常遇到的问题汇总
文章目录
- 问题:在C:\Users\cxq\AppData\Local\Programs\Python\Python310\Scripts 路径下没有pip脚本
- 问题: python解释器 与 pip脚本不匹配,pip脚本找不到路径
- 检查环境变量
- 问题 在cmd中 ,pip不是内部或外部命令的解决方案
- 问题 : 在cmd中 下载django 速度过慢
- 问题 : pycharm 打不开终端
- 1. 检查 PowerShell 路径
- 成功后
【python编程】pip安装和使用保姆级教程_哔哩哔哩_bilibili
根据该视频得出的问题以及后续在配置Django遇到的问题汇总
问题:在C:\Users\cxq\AppData\Local\Programs\Python\Python310\Scripts 路径下没有pip脚本
解决方案
C:\Users\cxq\AppData\Local\Programs\Python
重新安装python-3.10.11-amd64.exe , 需要勾选将Add to Path ,
否则在C:\Users\cxq\AppData\Local\Programs\Python\Python310\Scripts 下没有安装pip脚本
问题: python解释器 与 pip脚本不匹配,pip脚本找不到路径
问题:
PS D:\Training Program\meiduo_mall-master> pip --version
pip : 无法将“pip”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,
然后再试一次。
所在位置 行:1 字符: 1
+ pip --version
+ ~~~+ CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoundException+ FullyQualifiedErrorId : CommandNotFoundException
搜索"编辑系统环境变量"
-
在“系统变量”区域找到
Path
变量,选择它,然后点击“编辑”。 -
点击“新建”,然后添加 Python 和
Scripts
目录的路径Scripts一般的路径是 C:\Users\cxq\AppData\Local\Programs\Python\Python310\Scripts
在pycharm中配置python解释器
检查环境变量
确保 pip
的路径已经被添加到系统的 PATH
环境变量中。你可以在 PowerShell 中运行以下命令来查看 PATH
:
PS D:\Training Program\meiduo_mall-master> $env:PATH
C:\Users\cxq\AppData\Local\Programs\Python\Python313\Scripts\pip3.13.exe;C:\Users\cxq\AppData\Local\Programs\Python\Pyth
on312\Scripts\pip3.12.exe;D:\QBuild\OSGeo4W\apps\grass\grass84\bin;D:\QBuild\OSGeo4W\include;D:\QBuild\OSGeo4W\bin;D:\QBuild\OSGeo4W\lib;D:\QBuild\Cygwin\bin;D:\QBuild\Cygwin\lib;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Incredibuild;C:\Users\cxq\AppData\Local\Programs\Python\Python313\Scripts\pip3.13.exe;C:\Users\cxq\AppData\Local\Programs\Python\Python312\Scripts\pip3.12.exe;C:\Users\cxq\AppData\Local\Programs\Python\Launcher\;C:\Users\cxq\AppData\Local\Microsoft\WindowsApps;D:\vscode\Microsoft VS Code\bin;D:\vscode2\Microsoft VS Code\bin;C:\Users\cxq\.dotnet\tools;
PS D:\Training Program\meiduo_mall-master>
问题 在cmd中 ,pip不是内部或外部命令的解决方案
在cmd中进入 pip脚本所在的路径下
2、在环境变量中配置好pip脚本的路径后,直接在cmd中输入 pip 即可使用 ,这样就不需要在cmd中进入pip脚本的路径下,再输入pip
问题 : 在cmd中 下载django 速度过慢
解决方案 : 科学上网
问题 : pycharm 打不开终端
解决方案
1. 检查 PowerShell 路径
确保 PowerShell 的路径正确,并且可以在命令行中直接运行。在命令行中输入以下命令来检查 PowerShell 是否可用:
-
在 PyCharm 中配置 PowerShell 路径通常需要确保 PowerShell 可执行文件的路径被添加到系统的环境变量
PATH
中,这样 PyCharm 才能正确地调用 PowerShell。以下是如何设置 PowerShell 路径的步骤: -
-
找到 PowerShell 可执行文件的路径:
- 在 Windows 系统中,PowerShell 的可执行文件通常位于
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
。
- 在 Windows 系统中,PowerShell 的可执行文件通常位于
-
成功后
(.venv) PS D:\Training Program\Shopping-mall-management-system-master> pip --version
pip 25.1.1 from C:\Users\cxq\AppData\Local\Programs\Python\Python310\.venv\lib\site-packages\pip (python 3.10)
(.venv) PS D:\Training Program\Shopping-mall-management-system-master> python --version
Python 3.10.11