鱼C论坛

 找回密码
 立即注册
查看: 3894|回复: 46

[已解决]求助,python新手如何下载pip

[复制链接]
发表于 2021-7-28 22:15:37 | 显示全部楼层 |阅读模式
5鱼币
我用的python是 3.8 32-bit的版本,根据教程说这个版本应该已经自带pip。但不管我是在cmd还是在idle上打“pip”都没有反应。
1. 在idle上打pip会报错:
“Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    pip
NameError: name 'pip' is not defined”

2. 在cmd上打pip也会报错,代码如下:
C:\Users\admin(我的电脑用户名)>pip
然后报错:
“'pip' 不是内部或外部命令,也不是可运行的程序
或批处理文件。”

3. 我也去github里下载了easygui的文件,但是只有当我运行文件名为“setup.py”时我才可以“import easygui”,其它时间都不可以。

真不知道该怎么办了,就想装一个easygui去接着学python。麻烦各位大神看看有没有什么办法。
最佳答案
2021-7-28 22:15:38
谢谢各位的解答,尽管我现在由于SSL Error,pip还是不能用,但从大家的叙述中知道了很多东西,以及我自己找到了如何不用pip安装easygui的方法,现在贴出来,如果有人跟我一样怎么都用不了pip的话,可以采取该方法:
1. 下载module安装包
2. 解压缩
3. 将解压缩后的所有内容复制黏贴到C:\\Users\\Admin下
4. 打开cmd
5. 输入python setup.py install
这个方法受到这个帖子(https://stackoverflow.com/questi ... ut-pip-easy-install)的启发,如有需要请自己查询。
再次感谢各位的帮助!

最佳答案

查看完整内容

谢谢各位的解答,尽管我现在由于SSL Error,pip还是不能用,但从大家的叙述中知道了很多东西,以及我自己找到了如何不用pip安装easygui的方法,现在贴出来,如果有人跟我一样怎么都用不了pip的话,可以采取该方法: 1. 下载module安装包 2. 解压缩 3. 将解压缩后的所有内容复制黏贴到C:\%users\\Admin下 4. 打开cmd 5. 输入python setup.py install 这个方法受到这个帖子(https://stackoverflow.com/questions/13270877/how- ...
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-28 22:15:38 | 显示全部楼层    本楼为最佳答案   
谢谢各位的解答,尽管我现在由于SSL Error,pip还是不能用,但从大家的叙述中知道了很多东西,以及我自己找到了如何不用pip安装easygui的方法,现在贴出来,如果有人跟我一样怎么都用不了pip的话,可以采取该方法:
1. 下载module安装包
2. 解压缩
3. 将解压缩后的所有内容复制黏贴到C:\\Users\\Admin下
4. 打开cmd
5. 输入python setup.py install
这个方法受到这个帖子(https://stackoverflow.com/questi ... ut-pip-easy-install)的启发,如有需要请自己查询。
再次感谢各位的帮助!
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-28 22:21:04 | 显示全部楼层
重装python后我也出现了这个问题
找到Python38文件夹(在你的安装目录下),进入Scripts,复制pip.exe或pip3.exe,粘贴到cmd默认目录下
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-28 22:50:11 | 显示全部楼层
还要配置环境变量
参考这篇https://blog.csdn.net/songlh1234 ... 1018.2226.3001.4187
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-29 00:54:40 | 显示全部楼层
青出于蓝 发表于 2021-7-28 22:21
重装python后我也出现了这个问题
找到Python38文件夹(在你的安装目录下),进入Scripts,复制pip.exe或pi ...

谢谢,在把pip.exe复制到默认目录下后我可以看到pip是什么了,但是我还是无法安装easygui
我输入指令如下:
”C:\Users\WY2002>pip install easygui“
报错如下:
”WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
ERROR: Could not find a version that satisfies the requirement easygui (from versions: none)
ERROR: No matching distribution found for easygui“
请问这步又该怎么解决呢?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-29 01:48:35 | 显示全部楼层
大马强 发表于 2021-7-28 22:50
还要配置环境变量
参考这篇https://blog.csdn.net/songlh1234/article/details/82882386?ops_request_misc ...

谢谢,我修改完路径之后可以看到pip界面了,但是我还是无法安装easygui
我输入指令如下:
”C:\Users\WY2002>pip install easygui“
报错如下:
”WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
ERROR: Could not find a version that satisfies the requirement easygui (from versions: none)
ERROR: No matching distribution found for easygui“
请问这步又该怎么解决呢?
我去晚上找了一下说是超时,接不上外网。然后选用国内的pypi也是不可以的。
在cmd中打出如下字样:
“C:\Users\WY2002>pip install easygui -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple
然后报错为:
”ERROR: Could not find a version that satisfies the requirement easygui (from versions: none)
ERROR: No matching distribution found for easygui”
请问接下来怎么办呢?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-29 09:23:32 | 显示全部楼层
本帖最后由 nahongyan1997 于 2021-7-29 09:25 编辑
凌晨三点二十八 发表于 2021-7-29 01:48
谢谢,我修改完路径之后可以看到pip界面了,但是我还是无法安装easygui
我输入指令如下:
”C:%users\W ...


链接:https://pan.baidu.com/s/19LszaUy51S4AF1clFED2BQ
提取码:582a
--来自百度网盘超级会员V4的分享

把这个下载双击执行就好了,用完了直接把这个脚本存硬盘里以后遇到同样的问题可以直接用
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-29 09:30:35 | 显示全部楼层
凌晨三点二十八 发表于 2021-7-29 01:48
谢谢,我修改完路径之后可以看到pip界面了,但是我还是无法安装easygui
我输入指令如下:
”C:%users\W ...

重新装一下python。自带的pip。
之前也遇见过你这个问题,在Linux 下安装编译版的时候,报错后再用,就是这样,最后智能重装。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-29 09:41:33 | 显示全部楼层
pip是无法在IDLE里使用的,只能在cmd里使用
  1. pip install easygui -i http://pypi.douban.com/simple
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-29 12:32:57 | 显示全部楼层
python3每次安装会提示是否带环境变量,直接勾选
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-29 16:04:05 | 显示全部楼层
叼辣条闯世界 发表于 2021-7-29 09:41
pip是无法在IDLE里使用的,只能在cmd里使用

我就是在cmd里面打的....
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-29 16:25:25 | 显示全部楼层
塔利班 发表于 2021-7-29 12:32
python3每次安装会提示是否带环境变量,直接勾选

已经勾选了环境变量(add ... path)以及它的recommedation python launcher 也都装了,结果pip可以运行,但是报错如下:
”WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/easygui/
ERROR: Could not find a version that satisfies the requirement easygui (from versions: none)
ERROR: No matching distribution found for easygui“
请问这样该怎么解决?国内的pypi显示
”ERROR: Could not find a version that satisfies the requirement easygui (from versions: none)
ERROR: No matching distribution found for easygui”
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-29 16:27:15 | 显示全部楼层
nahongyan1997 发表于 2021-7-29 09:23
链接:https://pan.baidu.com/s/19LszaUy51S4AF1clFED2BQ
提取码:582a
--来自百度网盘超级会员V4 ...

下载了,双击执行了,但是还是不行
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-29 16:28:43 | 显示全部楼层
z5560636 发表于 2021-7-29 09:30
重新装一下python。自带的pip。
之前也遇见过你这个问题,在Linux 下安装编译版的时候,报错后再用,就 ...

重装成3.9版本的了,还是不行
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-29 16:33:24 | 显示全部楼层
凌晨三点二十八 发表于 2021-7-29 16:28
重装成3.9版本的了,还是不行

你重新装吧,把能打勾的全部打上去。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-29 16:48:52 | 显示全部楼层
z5560636 发表于 2021-7-29 16:33
你重新装吧,把能打勾的全部打上去。

能打勾的都打勾了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-29 17:06:47 | 显示全部楼层
凌晨三点二十八 发表于 2021-7-29 16:27
下载了,双击执行了,但是还是不行


那你用idle 执行一下看看有没有报错

推荐用 python 3.8
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-7-29 17:10:58 | 显示全部楼层
nahongyan1997 发表于 2021-7-29 17:06
那你用idle 执行一下看看有没有报错

推荐用 python 3.8

报错了,错误代码如下:
”WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /simple/pip/
ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip“
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-29 17:34:57 | 显示全部楼层
凌晨三点二十八 发表于 2021-7-29 16:25
已经勾选了环境变量(add ... path)以及它的recommedation python launcher 也都装了,结果pip可以运行 ...

..你的 easygui 怎么还带个冒号呢
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-7-29 18:09:42 | 显示全部楼层
凌晨三点二十八 发表于 2021-7-29 17:10
报错了,错误代码如下:
” [33mWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect ...

卸载干净点再重装吧,我也没遇到我也不知道。
不行就重做系统
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-3-29 02:50

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表