Today I installed NumPy with Conda. When doing that I created a new environment. After installing NumPy, I opened VS code and typed import numpy as np
. It underlined "numpy" as an error. I hovered over the word "numpy" to see the error and basically said it doesn't know what NumPy is. However, NumPy works in the Jupyter notebook. I did a little research about this and from what I read, I have to somehow change the environment (or do something with the enviorment) I'm using in Visual Studio Code. How do I do this?
Asked
Active
Viewed 2,074 times
-3

Random Programmer
- 55
- 9
-
1In the interest of content quality, duplicate questions aren't permitted. Please research your question before posting here in accordance with [ask]. This is a duplicate of [How can I change the Python version in Visual Studio Code?](https://stackoverflow.com/questions/48135624/how-can-i-change-the-python-version-in-visual-studio-code) – esqew Apr 03 '22 at 00:42
1 Answers
1
The reason this is not working is because you have not installed your library on your desktop. In order to use numpy on a desktop, you need to install the numpy library, whereas on Jupyter Notebooks, they have it preinstalled. So get pip on your computer, try this site https://www.geeksforgeeks.org/how-to-install-pip-in-macos/, and install numpy by using the command pip3 install numpy
using command line on windows or terminal for mac.

ThatOneAmazingPanda
- 302
- 4
- 13
-
Thank you! However I thought the whole point of Anaconda was to manage packages. Do you think it would be a good idea to install NumPy using pip or would it just become overwhelming with so many other packages in the future. – Random Programmer Apr 03 '22 at 01:27
-