dig_123
dig_123

Reputation: 2358

numpy behaves differently on a normal Jupiter notebook and one from a visual studio venv

I am running a web version of a Jupyter notebook from a course material, and this code cell runs through successfully:

enter image description here

But when I ran it from a VS CODE virtual environment, I get the below error. Please help with the error.

enter image description here

Upvotes: 0

Views: 87

Answers (1)

epursiai
epursiai

Reputation: 76

You are not stating what you mean by "web version". But in any case, you very likely have different versions of numpy. You can run

import numpy as np
np.__version__

in both of your environments to check the version you are using. Then, if you want to have the same version in your local VSCode, simply open the terminal and run

pip install numpy==x.y.z

Where x.y.z is the version you had in the web version.

Upvotes: 1

Related Questions