PIP Install error problem resolution
Sometimes the red Word error occurs when you install the Python library with the pip Install command
1. Error: Readtimeouterror:httpsconnectionpool (host= ' pypi.python.org ', port=443): Read timed out.
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\basecomman d.py ", line 215, in main status = Self.run (options, args) File" C:\PYTHON27\LIB\SITE-PACKAGES\PIP\COMMANDS\INSTALL.P Y ", line 335, in Run Wb.build (autobuilding=true) File" c:\python27\lib\site-packages\pip\wheel.py ", line 749, in Bui LD Self.requirement_set.prepare_files (Self.finder) File "c:\python27\lib\site-packages\pip\req\req_set.py", line 38 0, 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\dow nload.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:\python2 7\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, 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\ur llib3\response.py ", line 357, in stream data = Self.read (Amt=amt, decode_content=decode_content) File" c:\python27\l ib\site-packages\pip\_vendor\requests\packages\urllib3\response.py ", line 324, in read Flush_decoder = True File" c: \python27\lib\contextlib. py ", line __exit__ self.gen.throw (type, value, Traceback) File" C:\python27\lib\site-packages\pip\_vendor\re quests\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.
cause of error: Failed to download dependency package without the source of the PIP
resolution 1 (Recommended): Create Python file (. py) in the folder path where Pip is installed
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)
run this. py file on cmd
Then use pip install installation instructions to download very quickly
Resolution 2: Modify to increase timeout time
Pip--default-timeout=100 install-u pip
The following instructions are installed
Pip--default-timeout=100 install-u scrapy (library name)
Solution 3: to https://pypi.python.org/simple/pip/download corresponding to the. whl File
after downloading, install with PIP:
Pip Install (path)/PIP-8.1.2-PY2.PY3-NONE-ANY.WHL
2. Error: Permissionerror: [Winerror 5] denied access. : ' C:\Program FILES\PYTHON35\LIB\SITE-PACKAGES\XLWT '
Exception:traceback (most recent call last): File "C:\Program files\python35\lib\site-packages\pip\basecommand.py", Li NE 1, in main status = Self.run (options, args) File "C:\Program Files\python35\lib\site-packages\pip\commands\ins tall.py ", Li Ne 311, in Run Root=options.root_path, File" C:\Program Files\python35\lib\site-packages\pip\req\req_se
t.py ", line 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-packag Es\pip\req\req_install.py ", Lin E 998, in Move_wheel_files isolated=self.isolated, File" C:\Program Files\python35\l ib\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\l Ib\site-packages\pip\utils\__init__.py ", line-in-ensure_dir os.makedirs (path) File" C:\Program files\python35\lib\os.py ", line 241, in M Akedirs mkdir (name, mode) Permissionerror: [Winerror 5] denied access. : ' C:\\Program Files\\python35\\lib\\sit E-PACKAGES\\XLWT '
Solve:
Click Python27 folder-> Right key property-> Security-> edit-> Full Control-> allow-> save
3. Error: Unicodedecodeerror: ' ASCII ' codec can ' t decode byte 0xd3 in position 7:ordinal not in range (128)
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 Requir
Ement_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, in join Result_path = Result_path + P_path unicodedecodeerror : ' ASCII ' codec can ' t decode byte 0xd3 in Position 7:ordinal not in range (128)
Error Reason: Pip install python package will load directory contains Chinese characters, ASCII cannot encode
solve: Python directory python27\lib\site-packages build a file sitecustomize.py
Import Sys
Python will automatically run this file