简体   繁体   中英

Unable to Import & Import could not be resolved

i started programming today and i'm testing different code segments on Visual Studio Code. However, when i tried importing a "numpy", 2 errors occured. I then proceeded to check other stack-overflow posts regarding this and I tried switching the Python Interpreter, however nothing changed. I also attempted doing other suggestions, however I don't understand how to do some of the suggestions (its my first time programming etc.)

enter image description here

Below is a zoomed up picture of it enter image description here

I was wondering if I could get some help?

Try opening the project folder in VsCode instead of opening the file by itself. If that doesn't work, run the file through CMD, if running it through CMD doesn't work, you might not have the numpy library. You can do that by going to CMD and write the following command:

pip install numpy

Run

pip show numpy

in integrated terminal, check if its location is <your selected interpreter>\lib\site-packages .

If is, reload window then the error should go away.

If not, please open an integrated Terminal and reinstall the module to current selected python environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM