I was addicted to creating a Python venv environment with VS Code

Whenever I build a Python virtual environment for DynamoDb-Lambda in my local environment Since boto3 could not be imported, I would like to summarize the procedure with a memorandum.

Building the environment

--Create a virtual environment

$ python3 -m venv environment name

--Enable the created environment

$source The name of the environment/bin/activate

--When it is successfully enabled, the following display will be displayed.

(The name of the environment) $

--Install the required packages (boto3 in this case) By the way, I installed boto3 as it is without entering the environment, so boto3 will always be I was not on the virtual environment side. .. ..

$ pip install boto3

--Use the python -m pip list command to check if the target package is installed properly.

$ python -m pip list

Package         Version
--------------- -------
boto3           1.12.23
botocore        1.15.23
docutils        0.15.2
jmespath        0.9.5
numpy           1.18.2
pip             19.0.3
python-dateutil 2.8.1
s3transfer      0.3.3
setuptools      40.8.0
six             1.14.0
urllib3         1.25.8

It seems that this time it is well entered.

Settings on the VS Code side

--Open the folder created this time --Open setting.json and add the following I made a mistake in the description here, but the path was peeled off to an environment other than the virtual environment side, and boto3 could not be imported ...

"python.pythonPath": "bin/python3",

Reference site

-[Introduction to Python] An easy-to-understand explanation of how to create a virtual environment with venv -How to open VS Code settings.json

Recommended Posts

I was addicted to creating a Python venv environment with VS Code
A note I was addicted to when running Python with Visual Studio Code
A note I was addicted to when creating a table with SQLAlchemy
Build a python execution environment with VS Code
Prepare a Python virtual environment for your project with venv with VS Code
Steps to create a Python virtual environment with VS Code on Windows
I was addicted to scraping with Selenium (+ Python) in 2020
What I was addicted to when creating a web application in a windows environment
A story that I was addicted to when I made SFTP communication with python
Build a Python environment with WSL + Pyenv + Jupyter + VS Code
I tried to build an environment with WSL + Ubuntu + VS Code in a Windows environment
I want to build a Python environment
What I was addicted to Python autorun
What I was addicted to with json.dumps in Python base64 encoding
Try to create a python environment with Visual Studio Code & WSL
Create a simple Python development environment with VS Code and Docker
How to build Python and Jupyter execution environment with VS Code
When creating a pipenv environment, I got addicted to "Value Error: Not a valid python path"
What I was addicted to when dealing with huge files in a Linux 32bit environment
How to create a Python virtual environment (venv)
A story I was addicted to when inserting from Python to a PostgreSQL table
I want to make a game with Python
Python (Windows 10) Virtual Environment / Package with VS Code
A story I was addicted to trying to get a video url with tweepy
Use Python from Java with Jython. I was also addicted to it.
A memo when creating a python environment with miniconda
Commands for creating a python3 environment with virtualenv
Procedure for creating a Python quarantine environment (venv environment)
Use Python in Anaconda environment with VS Code
I made a tool to convert Jupyter py to ipynb with VS Code
I tried to build a Mac Python development environment with pythonz + direnv
I want to write to a file with Python
Make your Python environment "easy" with VS Code
I was addicted to trying Cython with PyCharm, so make a note
How to debug a Python program by remotely connecting to a Docker container in WSL2 environment with VS Code
[Python] When I tried to make a decompression tool with a zip file I just knew, I was addicted to sys.exit ()
When I tried to create a virtual environment with Python, it didn't work
Three things I was addicted to when using Python and MySQL with Docker
Python: Creating a virtual environment (venv), starting and stopping
Python Ver. To introduce WebPay with a little code.
I tried to draw a route map with Python
I made a Python3 environment on Ubuntu with direnv.
I want to work with a robot in python.
How to make a Python package using VS Code
I tried to automatically generate a password with Python3
A story that I was addicted to at np.where
What I was addicted to when using Python tornado
I want to run a quantum computer with Python
Python with VS Code (Windows 10)
Debug Python with VS Code
I was soberly addicted to calling awscli from a Python 2.7 script registered in crontab
Environment construction for those who want to study python easily with VS Code (for Mac)
Set up a Python development environment with Visual Studio Code
I made a package to filter time series with python
I wrote a program quickly to study DI with Python ①
How to use VS Code in venv environment on windows
I want to start a jupyter environment with one command
What I was addicted to when migrating Processing users to Python
I want to use a virtual environment with jupyter notebook!
How to build a python2.7 series development environment with Vagrant
I want to be able to run Python in VS Code