[PYTHON] I installed the library with Visual Studio Code, but Unable to import

I installed the library, but Unable to import

Even though I matched the version with Django, it was pointed out by vscode all the time, so I will write the cause and solution.

Cause

This is because the execution environment and VS Code virtual environment are different **.

For example, let's say you have a Python virtual environment called A, B.

Even if you install the library on A, if you use B and run it with VS Code, it will be pointed out.

solution

  1. Press the part where ** Python Version ** is written at the bottom left. Sept19-Linting.png

  2. Since multiple environments will appear, the indication should disappear by adjusting to the environment you are running. Thank you for your hard work.

reference

https://stackoverflow.com/questions/48270385/vs-code-error-when-importing-django-module

Recommended Posts

I installed the library with Visual Studio Code, but Unable to import
A note I was addicted to when running Python with Visual Studio Code
Preparing to use Tensorflow (Anaconda) with Visual Studio Code
How to debug the Python standard library in Visual Studio
Settings to debug the contents of the library with VS Code
Java with Visual Studio Code (Part 2)
[Python] How to import the library
Try to create a python environment with Visual Studio Code & WSL
Unable to import packages installed in virtual environment with Anaconda on Windows 10
I tried to get the authentication code of Qiita API with Python.
I tried with the top 100 PyPI packages> I tried to graph the packages installed on Python
I tried to visualize the model with the low-code machine learning library "PyCaret"
The file edited with vim was readonly but I want to save it
I tried to extract named entities with the natural language processing library GiNZA
Build Python development environment with Visual Studio Code
I tried to save the data with discord
I wanted to play with the Bezier curve
I wanted to visualize 3D particle simulation with the Python visualization library Matplotlib.
I customized it with Visual Studio Code (mainly for python), so I will summarize it
How to get started with Visual Studio Online ~ The end of the environment construction era ~
How to test the current time with Go (I made a very thin library)
I tried to learn the sin function with chainer
I tried to graph the packages installed in Python
I installed and used the Deep Learning library Chainer
I want to scroll the Django shift table, but ...
I tried to touch the CSV file with Python
I tried to solve the soma cube with python
I wanted to use the Python library from MATLAB
How to export / import Zope zope object installed with Plone-4.1.5-UnifiedInstaller-20120604.tgz
I want to inherit to the back with python dataclass
Python development environment with Windows + Anaconda3 + Visual Studio Code
Python development environment with Windows + Python + PipEnv + Visual Studio Code
I tried to solve the problem with Python Vol.1
I felt that I ported the Python code to C ++ 98.
I wrote you to watch the signal with Go
unable to import django
The sound of tic disorder at work is ... I managed to do it with the code
I tried to find the entropy of the image with python
I want to remove Python's Unresolved Import Warning with vsCode
I tried to simulate how the infection spreads with Python
I tried to analyze the whole novel "Weathering with You" ☔️
How to use linux commands in Visual Studio Code terminal
I wrote the code for Japanese sentence generation with DeZero
I wanted to solve the Panasonic Programming Contest 2020 with Python
I tried to find the average of the sequence with TensorFlow
Set up a Python development environment with Visual Studio Code
Enable the virtualenv Python virtual environment for Visual Studio Code
I tried to notify the train delay information with LINE Notify
I installed the automatic machine learning library auto-sklearn on centos7
Move what you installed with pip to the conda environment
I want to change the Japanese flag to the Palau flag with Numpy
What I did to welcome the Python2 EOL with confidence
I tried to summarize the code often used in Pandas
What has changed since I started using Visual Studio Code
[Python] I want to use the -h option with argparse
I can't log in to the admin page with Django3
I captured the Touhou Project with Deep Learning ... I wanted to.
I want to map the EDINET code and securities number
I tried to divide the file into folders with Python
I tried the changefinder library!
Check the code with flake8