【发布时间】:2021-01-08 02:19:44
【问题描述】:
我似乎无法正确安装请求包。不管我使用什么来实际运行我的程序,我都会得到同样的错误:
Traceback (most recent call last): File "/Users/garce/Desktop/songlyrics/getlyrics.py", line 2, in <module> import requests ModuleNotFoundError: No module named 'requests'
但是,我使用 pip 来安装请求。当我在终端窗口中运行pip show requests 时,它会出现:
Name: requests Version: 2.24.0 Summary: Python HTTP for Humans. Home-page: https://requests.readthedocs.io Author: Kenneth Reitz Author-email: me@kennethreitz.org License: Apache 2.0 Location: /Users/garce/opt/anaconda3/lib/python3.8/site-packages Requires: urllib3, idna, certifi, chardet Required-by: Sphinx, jupyterlab-server, conda, conda-build, anaconda-project, anaconda-client
我认为这是某种路径问题,但我无法弄清楚这里出了什么问题。有什么想法吗?
【问题讨论】:
-
请分享您如何(以及在何处)使用 pip 命令,以及您是如何运行脚本的。
标签: python path pip python-requests package