简体   繁体   中英

How can I find newly installed python module in VS code?

I just installed the new python3 module using terminal of Visual Studio Code on ubuntu.

When I import it, this error occurred.

[Python (analysis)] Unable to resolve 'new module'. IntelliSense may be missing for this module.

But the new module surely installed successfully. (I can import it in my ubuntu terminal)

How can I import that new python module in VS code?

You should look up the official docs on it. They have a neat tutorial to get you started.

Here are a few excerpts that should help you:

An "environment" in Python is the context in which a Python program runs. An environment consists of an interpreter and any number of installed packages. Because many programs are written specifically for a certain Python interpreter and makes use of a set of libraries, developers often create and manage an environment for individual programs.

When working with Python in VS Code, you select from available environments using the Python: Select Interpreter command. The Python extension then uses that selected environment for IntelliSense, auto-completions, linting, formatting, and any other language-related features. (The environment is not, however, used for debugging; see Choose a debugging environment.)

The selected environment is also automatically activated when using the Python: Run Python File in Terminal and Python: Create Terminal commands. Installing (or uninstalling) a package in the Terminal with a command like pip install matplotlib installs (or uninstalls) the package in whatever environment is active in that Terminal.

Note: By default, the Python extension looks for and uses on the first Python interpreter it finds in the system path. If it doesn't find an interpreter, it issues a warning. On macOS, the extension also issues a warning if you're using the OS-installed Python interpreter, because you typically want to use an interpreter you install directly. In either case, you can disable these warnings by setting python.disableInstallationCheck to true in your user settings.

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