python27和python36 共存时安装pip方法,解决python27文件夹下没有script文件方法
报错:
D:\PYTHON2.7>python ez_setup.py
Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Traceback (most recent call last):
File "ez_setup.py", line 278, in <module>
main(sys.argv[1:])
File "ez_setup.py", line 210, in main
egg = download_setuptools(version, delay=0)
File "ez_setup.py", line 158, in download_setuptools
src = urllib2.urlopen(url)
File "D:\PYTHON2.7\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "D:\PYTHON2.7\lib\urllib2.py", line 397, in open
response = meth(req, response)
File "D:\PYTHON2.7\lib\urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "D:\PYTHON2.7\lib\urllib2.py", line 435, in error
return self._call_chain(*args)
File "D:\PYTHON2.7\lib\urllib2.py", line 369, in _call_chain
result = func(*args)
File "D:\PYTHON2.7\lib\urllib2.py", line 518, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: SSL is required
方法一:(我的显示报错如上图)
1. 在Python IDLE下,我们输入以下代码
from urllib import urlopen【回车】
data = urlopen('http://peak.telecommunity.com/dist/ez_setup.py')【回车】
open('ez_setup.py','wb').write(data.read())【回车】
exit()
2.在计算的cmd程序下,切换到自己的安装目录python环境中,执行python ez_setup.py
3.如此,easy_install安装成功。easy_install在目录C:\Python27\Scripts 下面。
4.在cmd下,切换到目录C:\Python27\Scripts,运行 easy_inatall pip命令。
5.将C:\Python27\Scripts 配置到环境变量;
6.pip安装成功后,在cmd下执行pip,可现实安装成功结果。
7.然后就可以用pip安装各种插件,如pip install requests.
方法二:(属实可行好用)
直接启动pycharm
利用更改环境 设置中的那个Interprete 加入你2.7的安装目录
它就会自动提示你安装pip相关的。
方法三:
直接下载一个相同版本的Script目录