Downloading xgboost-0.6a2.tar.gz (1.2MB)
48% |███████████████▋ | 583kB 47kB/s eta 0:00:13Exception:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\python27\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "c:\python27\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "c:\python27\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "c:\python27\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "c:\python27\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "c:\python27\lib\site-packages\pip\download.py", line 659, in unpack_http_url
hashes)
File "c:\python27\lib\site-packages\pip\download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "c:\python27\lib\site-packages\pip\download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "c:\python27\lib\site-packages\pip\utils\hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "c:\python27\lib\site-packages\pip\download.py", line 571, in written_chunks
for chunk in chunks:
File "c:\python27\lib\site-packages\pip\utils\ui.py", line 139, in iter
for x in it:
File "c:\python27\lib\site-packages\pip\download.py", line 560, in resp_read
decode_content=False):
File "c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 357, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 324, in read
flush_decoder = True
File "c:\python27\lib\contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 246, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
import os
ini="""[global]
index-url = https://pypi.doubanio.com/simple/
[install]
trusted-host=pypi.doubanio.com
"""
pippath=os.environ["USERPROFILE"]+"\\pip\\"
if not os.path.exists(pippath):
os.mkdir(pippath)
with open(pippath+"pip.ini","w+") as f:
f.write(ini)
pip --default-timeout=100 install -U pip
如下指令安装
pip --default-timeout=100 install -U scrapy(库名)
pip install (path)/pip-8.1.2-py2.py3-none-any.whl
Exception:
Traceback (most recent call last):
File "c:\program files\python35\lib\site-packages\pip\basecommand.py", line 21
1, in main
status = self.run(options, args)
File "c:\program files\python35\lib\site-packages\pip\commands\install.py", li
ne 311, in run
root=options.root_path,
File "c:\program files\python35\lib\site-packages\pip\req\req_set.py", line 64
6, in install
**kwargs
File "c:\program files\python35\lib\site-packages\pip\req\req_install.py", lin
e 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "c:\program files\python35\lib\site-packages\pip\req\req_install.py", lin
e 998, in move_wheel_files
isolated=self.isolated,
File "c:\program files\python35\lib\site-packages\pip\wheel.py", line 339, in
move_wheel_files
clobber(source, lib_dir, True)
File "c:\program files\python35\lib\site-packages\pip\wheel.py", line 310, in
clobber
ensure_dir(destdir)
File "c:\program files\python35\lib\site-packages\pip\utils\__init__.py", line
71, in ensure_dir
os.makedirs(path)
File "c:\program files\python35\lib\os.py", line 241, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files\\python35\\Lib\\sit
e-packages\\xlwt'
点击python27文件夹->右键属性->安全->编辑->完全控制->允许->保存
Exception:
Traceback (most recent call last):
File “c:\python27\lib\site-packages\pip\basecommand.py”, line 215, in main
status = self.run(options, args)
File “c:\python27\lib\site-packages\pip\commands\install.py”, line 324, in run
requirement_set.prepare_files(finder)
File “c:\python27\lib\site-packages\pip\req\req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “c:\python27\lib\site-packages\pip\req\req_set.py”, line 620, in _prepare_file
session=self.session, hashes=hashes)
File “c:\python27\lib\site-packages\pip\download.py”, line 821, in unpack_url
hashes=hashes
File “c:\python27\lib\site-packages\pip\download.py”, line 659, in unpack_http_url
hashes)
File “c:\python27\lib\site-packages\pip\download.py”, line 880, in _download_http_url
file_path = os.path.join(temp_dir, filename)
File “c:\python27\lib\ntpath.py”, line 85, in join
result_path = result_path + p_path
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xd3 in position 7: ordinal not in range(128)
import sys
sys.setdefaultencoding('gbk')