0

Disclaimer: in my first semester learning python and every answer I've found for this either hasn't worked or is way over my head. My Teachers Aid runs MacOS and I'm on Windows so he claims hasn't been able to help.

I'm trying to install the packages 'requests' and 'beautifulsoup' for a homework assignment. I installed pip, then requests, (through cmd prompt) and the cmd prompt says successfully installed but VSCode gives me "ModuleNotFoundError: No module named 'requests'". I uninstalled requests then tried to reinstall and I get "Requirement already satisfied". Then I tried to follow this YouTube video (It's short) "https://www.youtube.com/watch?v=paRXeLurjE4" And after step 3, to update pip and install packages I get the following:

"

C:\Users\honeycuttsierra\AppData\Local\Programs\Python\Python39>python -m pip install --upgrade pip
Requirement already satisfied: pip in c:\users\honeycuttsierra\appdata\local\programs\python\python39\lib\site-packages (21.1.3)
Collecting pip
  Using cached pip-21.2.4-py3-none-any.whl (1.6 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.1.3
    Uninstalling pip-21.1.3:
      Successfully uninstalled pip-21.1.3
  WARNING: The scripts pip.exe, pip3.9.exe and pip3.exe are installed in 'C:\Users\honeycuttsierra\AppData\Local\Programs\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.2.4" 

So how do I add pip.exe, pip3.9.exe and pip3.exe to PATH permanently? Will this fix my issue?

  • You need to add the directory `Python39` to your PATH via editing your environment variables. Here's an article I found on google: https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/ – ddejohn Aug 27 '21 at 03:55
  • Also, make sure that the python installation that your pip is installing requests to matches with the python installation that vscode is using. An easy way to check this would be to look up the path that your vscode is using for its python.exe, and look in the site-packages directory for requests. If it is there, your error is python not being on your PATH. If it isn't, then your cmd and vscode are using different installations of python on your computer. Sorry for the wordy comment and Welcome to stackoverflow. – Austin Aug 27 '21 at 06:53
  • blorgon - your article was exactly what i needed, thank you! All fixed now. – Sierra Honeycutt Aug 27 '21 at 07:12
  • https://stackoverflow.com/search?q=%5Bpip%5D+%5Bwindows%5D+path – phd Aug 27 '21 at 14:37
  • `setx PATH "%PATH%;C:\Python39\Scripts"` – phd Aug 27 '21 at 14:37

0 Answers0