For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

No Module named 'requests'

Hi all, I am hoping for a little help. In Visual Studio I am running some code and am getting an error with import requests, when I run the code, it tells me no module named 'requests'. However, if I run the same code in Jupyter notebook it works fine. I have run pip install requests in my environment and it is already satisfied. Any ideas on why it would work in one notebook vs. the other?
eikoneikon-data-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apirequest
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
1 0 0 0

0 Like Reply Share

More...


Initially I used pip install requests within VS. The request came back, all requirements satisfied. I restarted VS with a new terminal and tried pip install requests again. This time it installed requests and then everything worked fine.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
18.1k 21 12 20

Hi @milan.hedstrom

I have never used Visual Studio but from your question, it seems to be a Visual Studio environment issue.

So I google "visual studio pip install python" and I got this url,

https://docs.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-05-installing-packages?view=vs-2019

Hope this help.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.9k 87 10 22

Hi @milan.hedstrom

I had similar issues myself when I was trying out VS and for me, it was as explained in the link above - my VS and Jupyter were using different Python environments.

the missing package was installed in the Jupyter used env but not in the VS env

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks, I had that thought as well. I then opened a terminal within VS and did pip install requests and it comes up as already satisfied...

Upvotes
1 0 0 0

it is working now, I have figured it out. Many thanks for the replies.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Initially I used pip install requests within VS. The request came back, all requirements satisfied. I restarted VS with a new terminal and tried pip install requests again. This time it installed requests and then everything worked fine.