Home > Blockchain >  Problem with running python code on VS Code
Problem with running python code on VS Code

Time:04-26

[enter image description here][1]

Hello there, I am facing the problem you can see in the image. [1]: https://i.stack.imgur.com/qjV9Z.png

I have python installed in the D directory and added to path, everything looks like it should work. I am creating a virtual environment for every project I am working on and I don't have any problems running commands like "pip install numpy" but when I try to run my code, even trying to import libraries it fails and the output in the picture is not very significant to me. Has anyone faced a similar problem? can anyone help me?

Thanks in advance!

CodePudding user response:

Judging from your screenshot, you have a file named numpy.py somewhere in your PYTHONPATH, causing Python to import that particular file instead of the NumPy library you intended.

See this link for more information on how Python import works: https://bic-berkeley.github.io/psych-214-fall-2016/sys_path.html

  • Related