C:\Users\Qin>pip install setuptools
Collecting setuptools
Downloading http://mirrors.aliyun.com/pypi/packages/3b/7e/293d19ccd106119e35db4bf3e111b1895098f618b455b758aa636496cf03/setuptools-28.8.0-py2.py3-none-any.whl (472kB)
100% |████████████████████████████████| 481kB 6.4MB/s
Installing collected packages: setuptools
Successfully installed setuptools-28.8.0
C:\Users\Qin>pip install requests[socks]
Requirement already satisfied: requests[socks] in e:\python\lib\site-packages
Collecting PySocks!=1.5.7,>=1.5.6; extra == "socks" (from requests[socks])
Downloading http://mirrors.aliyun.com/pypi/packages/03/a5/957346ba692216cc00e8146fb1a5da0854f8320d7eb073b1cfcb7ad977b5/PySocks-1.5.6.tar.gz
Could not import setuptools which is required to install from a source distribution.
Traceback (most recent call last):
File "e:\python\lib\site-packages\pip\req\req_install.py", line 387, in setup_py
import setuptools # noqa
File "e:\python\lib\site-packages\setuptools\__init__.py", line 10, in <module>
from setuptools.extern.six.moves import filter, filterfalse, map
File "e:\python\lib\site-packages\setuptools\setuptools\__init__.py", line 11, in <module>
from setuptools.extension import Extension
File "e:\python\lib\site-packages\setuptools\extension.py", line 7, in <module>
from setuptools.extern.six.moves import map
ImportError: No module named extern.six.moves
参照网上试过
pip install -U setuptools
也试过用命令重装setuptools。问题依旧。
最终前往X:\python\lib\site-packages,将两个setuptools相关文件夹和一个six-1.10.0删除后,重新安装setuptools,然后安装pip install requests[socks],就一切正常了!