Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode did not recognize my Installed Python Packages

VSCode on Windows with Python. Installed Python Extension by Don, not sure it makes any difference, but thought of giving my Environment

Using VSCode for Python and in that process, i installed metapy package. I was able to run this metapy inside the terminal windows in VSCode but not in the Editor

PS C:\Users\xxx> python --version
Python 3.6.2 :: Anaconda custom (64-bit)
PS C:\Users\xxx> pip --version
pip 9.0.1 from C:\Program Files\Anaconda3\lib\site-packages (python 3.6)
PS C:\Users\xxx> pip install metapy
Requirement already satisfied: metapy in c:\program files\anaconda3\lib\site-packages
PS C:\Users\xxx> python
Python 3.6.2 |Anaconda custom (64-bit)| (default, Jul 20 2017, 12:30:02) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import metapy
>>> metapy.log_to_stderr()

From Terminal Window, it works fine, but metapy Package is not recognized from the Editor. Do i have to set something for Editor to recognize my Packages.

Try to set the Python path "python.pythonPath": "C:\Program Files\Python36\python.exe"

like image 284
Sudheer Avatar asked Aug 19 '26 00:08

Sudheer


1 Answers

Sometimes VS code does not recognize some libraries for me too. It's happening to me because I have multiple Python versions installed. To solve this problem I just swap to the version that accepts it.

You can change versions like that:

  1. In your bottom right corner, you will have {} Python <Version> - click on it. enter code here
  2. Just choose the right version for you. enter image description here
like image 121
David Avatar answered Aug 21 '26 15:08

David