【问题标题】:Install request library with anaconda使用 anaconda 安装请求库
【发布时间】:2019-10-19 20:57:06
【问题描述】:

我尝试使用 sudo pip install requests 但终端一直说:

(base) OSX-MacBook-Pro:~ osx$ sudo pip install requests
WARNING: The directory '/Users/osx/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/osx/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: requests in /anaconda3/lib/python3.7/site-packages (2.22.0)
Requirement already satisfied: certifi>=2017.4.17 in /anaconda3/lib/python3.7/site-packages (from requests) (2019.9.11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /anaconda3/lib/python3.7/site-packages (from requests) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /anaconda3/lib/python3.7/site-packages (from requests) (1.24.2)
Requirement already satisfied: idna<2.9,>=2.5 in /anaconda3/lib/python3.7/site-packages (from requests) (2.8)

P/s:我之前安装过 Anaconda,现在已经卸载了。

【问题讨论】:

    标签: python python-3.x pip anaconda


    【解决方案1】:
    • 要在 Anaconda 环境中安装库,您应该这样做 conda install &lt;library_name&gt;
    • 要安装 requests 库,应该是 conda install requests

    【讨论】:

      【解决方案2】:

      试试这个:

      conda install requests

      如果您已经安装了请求,那么您的 python 解释器可能正在为您的包查找错误的目录

      【讨论】:

        猜你喜欢
        • 2013-11-07
        • 2014-09-29
        • 2020-05-05
        • 2020-03-06
        • 2019-06-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多