Vscode does not recognize external modules in Python

Asked

Viewed 1,925 times

0

I am using vscode to learn python because I found it more pleasant, but when I try to import libraries from pypi.org after downloading them VSCODE points out that there is no module with that name to import. If I type Pip install pydf (example of module I have installed) by the VSCODE console it points out that it is already installed. If I go in my virtualEnv folder the pydf file is there, but at the time of running the code gives error, what to do?

Edit1: In case I run the same script using the same virtualEnv by Pycharm works normally, but I am using VSCODE due to the ease of integrating with github desktop

  • Checks whether the python version in Vscode is the same as the python version that is installing the libraries. Sometimes at your prompt you are dealing with python 2.7 and Vscode python 3.7, and the computer is giving preference to version 2.7

  • 1

    To find out this, in the lower right corner of Vscode shows the version of python he is using. To find out the version you are using to install the libraries, at the prompt (as Adm) write python, soon vc will enter the python terminal and will show the version you are using

  • I recommend using something simpler to learn. Like the very Idle that comes with python. If you’re interested, anaconda is a great platform alternative to set up environments with the Conda and install any dependencies you need. There is even a plugin in the anaconda vscode to select the environment you want to work in and more.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.