python3 requests 安装包下载安装[windows]
- |
- 浏览:54
- |
- 更新:2016-07-25 17:09
windows下直接使用:easy_install requests或者pip install requests来安装总是报错:要么找不到安装包,要么timedout。总之一个不爽。现在还是介绍下载离线源码手动安装的方法。
方法/步骤
-
1. 在http://cn.python-requests.org/zh_CN/latest/user/install.html#pip-install-requests 页面找到”也可以下载 tarball:“超链接( https://github.com/kennethreitz/requests/tarball/master ),右键》链接另存为 下载安装包“kennethreitz-requests-v2.10.0-63-gfb01456.tar.gz”。
-
2. 用WinRAR等解压其中的kennethreitz-requests-fb01456到Python 3安装目录 d:ProgramsPythonPython35-32kennethreitz-requests-fb01456。
-
3. 开始》运行》cmd打开一个命令行窗口,依次输入以下三个命令:
d:
cd d:ProgramsPythonPython35-32kennethreitz-requests-fb01456>
d:ProgramsPythonPython35-32kennethreitz-requests-fb01456>..python setup.py install
其中:
第一个命令切换当前目录到D盘
第二个命令切换当前目录到下载解压的requests在Python3安装的位置
第三个命令调用父目录下的python.exe执行requests的安装脚本即setup.py,参数是install
-
安装完成的部分提示:
creating builddist.win32eggEGG-INFO
copying requests.egg-infoPKG-INFO -> builddist.win32eggEGG-INFO
copying requests.egg-infoSOURCES.txt -> builddist.win32eggEGG-INFO
copying requests.egg-infodependency_links.txt -> builddist.win32eggEGG-INFO
copying requests.egg-info ot-zip-safe -> builddist.win32eggEGG-INFO
copying requests.egg-info equires.txt -> builddist.win32eggEGG-INFO
copying requests.egg-info op_level.txt -> builddist.win32eggEGG-INFO
creating dist
creating 'dist equests-2.10.0-py3.5.egg' and adding 'builddist.win32egg' to
it
removing 'builddist.win32egg' (and everything under it)
Processing requests-2.10.0-py3.5.egg
creating d:programspythonpython35-32libsite-packages equests-2.10.0-py3.5.
egg
Extracting requests-2.10.0-py3.5.egg to d:programspythonpython35-32libsite-
packages
Adding requests 2.10.0 to easy-install.pth file
Installed d:programspythonpython35-32libsite-packages equests-2.10.0-py3.5
.egg
Processing dependencies for requests==2.10.0
Finished processing dependencies for requests==2.10.0
-
在IDLE中输入import requests,如果没提示错误,那说明已经安装成功了!