windows系统中使用pip install时, 由于以前将python安装在C盘, 后面移动到了D盘, 导致pip使用不了报错如下
Collecting distribute Using cached distribute-0.7.3.zip (145 kB) ERROR: Command errored out with exit status 1: command: 'd:\python3.6\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\86134\\AppData\\Local\\Temp\\pip-install-j7hod2m5\\distribute\\setup.p y'"'"'; __file__='"'"'C:\\Users\\86134\\AppData\\Local\\Temp\\pip-install-j7hod2m5\\distribute\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().re place('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\86134\AppData\Local\Temp\pip-pip-egg-info-y2ks1a45' cwd: C:\Users\86134\AppData\Local\Temp\pip-install-j7hod2m5\distribute\ Complete output (15 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\86134\AppData\Local\Temp\pip-install-j7hod2m5\distribute\setuptools\__init__.py", line 2, in <module> from setuptools.extension import Extension, Library File "C:\Users\86134\AppData\Local\Temp\pip-install-j7hod2m5\distribute\setuptools\extension.py", line 5, in <module> from setuptools.dist import _get_unpatched File "C:\Users\86134\AppData\Local\Temp\pip-install-j7hod2m5\distribute\setuptools\dist.py", line 7, in <module> from setuptools.command.install import install File "C:\Users\86134\AppData\Local\Temp\pip-install-j7hod2m5\distribute\setuptools\command\__init__.py", line 8, in <module> from setuptools.command import install_scripts File "C:\Users\86134\AppData\Local\Temp\pip-install-j7hod2m5\distribute\setuptools\command\install_scripts.py", line 3, in <module> from pkg_resources import Distribution, PathMetadata, ensure_directory File "C:\Users\86134\AppData\Local\Temp\pip-install-j7hod2m5\distribute\pkg_resources.py", line 1518, in <module> register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider) AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. 看到最后的提示python setup.py 问题,于是找到最新安装python安装目录下的这个文件修改如下(添加当前python安装目录下的这两个文件路径) 终于改回来了