0

It worked...

Im on mac OS 10.15.7 and I have a function in a python script that needs the requests module. I followed the installation outlined here by user TheoretiCAL.

Last week I ran the script successfully from the VS code interpreter using python3.9.1.

...until it didn't:

Today I had to import requests in jupyter still in VS code. The module is not found despite VS being set to

  • python3.9.1 in the lower left corner
  • pip --version giving me:

pip 21.1.1 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)

  • import sys print(sys.version) giving me 3.9.1
  • Also jupyter is running the right kernel as seen in the top right corner of VS (screenshot at the bottom of the page)

Unfortunately this did not help me any further either.

From my side it looks like I've done everything that is recommended. What did my tiny beginners brain miss?

enter image description here

enter image description here

Thank you for your help

ilam engl
  • 738
  • 1
  • 5
  • 18

1 Answers1

1
  1. After selecting interpreter, you may install the module in current environment;

  2. Choose the same environment for Jupyter;

  3. Use pip show requests to check its location. If not in current selected environment, enter the environment and reinstall it.

enter image description here

Molly Wang-MSFT
  • 5,681
  • 1
  • 3
  • 17
  • 1
    All I wanna do is to solve your question and I'm glad to know it's already been resolved. so, it doesn't matter if you mark my answer now. Happy Coding. :) – Molly Wang-MSFT May 21 '21 at 02:49