我正在尝试使用 easy_install 安装“请求模块”,但出现以下错误:
$ sudo easy_install requests
Processing requests
error: Not a recognized archive type: requests
Run Code Online (Sandbox Code Playgroud)
如果我尝试使用pip,则会出现以下错误:
$ pip install requests
Unknown or unsupported command 'install'
Run Code Online (Sandbox Code Playgroud)
我只是运行了与您相同的命令,并没有产生相同的错误。
$ sudo easy_install requests
Searching for requests
Reading http://pypi.python.org/simple/requests/
Best match: requests 2.0.0
Downloading https://pypi.python.org/packages/source/r/requests/requests-2.0.0.tar.gz#md5=856fc825c17483e25fd55db115028e3f
Processing requests-2.0.0.tar.gz
Writing /tmp/easy_install-8vDXEw/requests-2.0.0/setup.cfg
Running requests-2.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-8vDXEw/requests-2.0.0/egg-dist-tmp-HTUm16
Adding requests 2.0.0 to easy-install.pth file
Installed /usr/local/lib/python2.7/dist-packages/requests-2.0.0-py2.7.egg
Processing dependencies for requests
Finished processing dependencies for requests
$ pip install requests
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/dist-packages/requests-2.0.0-py2.7.egg
Cleaning up...
Run Code Online (Sandbox Code Playgroud)
我必须检查日志内容,但正如您所见,pip 工作得很好。您可能需要重新安装 pip:
sudo apt-get --purge autoremove pip
sudo apt-get install pip
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
33029 次 |
| 最近记录: |