0

I can't seem to get the requests package to install correctly. Regardless of what I use to actually run my program, I get the same error:

Traceback (most recent call last): File "/Users/garce/Desktop/songlyrics/getlyrics.py", line 2, in <module> import requests ModuleNotFoundError: No module named 'requests'

However, I've used pip to install requests. When I run pip show requests in a terminal window, it comes up with this:

Name: requests Version: 2.24.0 Summary: Python HTTP for Humans. Home-page: https://requests.readthedocs.io Author: Kenneth Reitz Author-email: [email protected] 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

I assume this is a path issue of some sort, but I can't figure out what's going wrong here. Any idea?

1
  • Please share how (and where) are you using the pip command, and how are you running the script. Commented Sep 22, 2020 at 7:06

1 Answer 1

1

Are you installing the package globally, or within a pipenv environment? If globally, have you tried pipenv? Not only is it considered best practices, but I find that using pipenv or Anaconda environments often resolves path issues I experience.

Sign up to request clarification or add additional context in comments.

2 Comments

I tried pipenv and it seemed to work!! I was a little reticent to as I've heard pipenv n00bs can screw up their computers by trying it but nothing bad has happened so far
For what it's worth, you absolutely can screw up your computer with pipenv. So, like, being careful. None of it is really irreversible (at least not on the Linux/Mac systems I've used, and I doubt that Windows is any different) but I can't say that I have been able to clear all my own detritus from pipenv. Personally, I would highly recommend Anaconda, but I know this is not the popular answer and stems largely from my data science background.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.