安装requests
出现问题一:
不是内部或外部命令,也不是可运行程序或批处理文件
先确定Python\Scripts的文件夹下是否存在pip.exe
(1)如果存在,则将Scripts这个文件目录加入环境变量,具体方法:这台电脑——右键“属性”——高级系统设置——环境变量——path——编辑——将文件目录粘进去就OK了
(2)如果不存在,windows 的是先安装 easy_install ,然后通过easy_install 安装pip,easy_install地址链接:http://pypi.python.org/pypi/setuptools
下载完成后双击执行安装文件,即可在Scripts目录下运行安装easy_install
然后重复(1)配置环境变量就可以了。
问题二:
C:\WINDOWS\system32>pip install requests
Collecting requests
Exception:
Traceback (most recent call last):
File "d:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "d:\python27\lib\site-packages\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "d:\python27\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "d:\python27\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "d:\python27\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "d:\python27\lib\site-packages\pip\download.py", line 659, in unpack_http_url
hashes)
File "d:\python27\lib\site-packages\pip\download.py", line 880, in _download_http_url
file_path = os.path.join(temp_dir, filename)
File "d:\python27\lib\ntpath.py", line 85, in join
result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 7: ordinal not in range(128)