This question already has answers here:
Python 3.2 Unable to import urllib2 (ImportError: No module named urllib2) [duplicate]
                                
                                    (3个答案)
                                
                        
                                2年前关闭。
            
                    
我正在尝试在cmd控制台中安装urllib2以从python 3.5导入它。
我收到此错误:

pip install urllib2



  urllib2的构建轮失败
  
  命令“ c:\ anaconda \ python.exe -u -c”导入setuptools,标记化;文件='C:\ Users \ NA401134 \ AppData \ Local \ Temp \ pip-build-7meqhp18 \ urllib2 \ setup.py'; f = getattr(tokenize,'open',open)(文件); code = f.read()。replace('\ r \ n','\ n'); f.close(); exec(compile(code,文件,“ exec”))”安装--record C:\ Users \ NA401134 \ AppData \ Local \ Temp \ pip-it4nmmne-record \ install-record.txt --single-version-externally-managed --compile“失败在C:\ Users \ NA401134 \ AppData \ Local \ Temp \ pip-build-7meqhp18 \ urllib2 \中的错误代码为1

最佳答案

urllib2是Python 2中的内置软件包。您无需pip install即可。你是说urllib3吗?

关于python - pip install urllib2 #failed ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46228725/

10-12 22:03