It's okay to see the details by looking at other people's articles, but I thought that there are few things that can be understood in one article as to what can be done during development. I tried to summarize that it is not enough for everyone to understand, but that it is enough for me.
Until Pipenv is installed Look at this
For Python 3 series
$ pipenv --python 3
$ pipenv install django
$ pipenv install numpy==1.17.4 #Specify the version
Pipfile
[packages]
django = "*"
numpy = "1.17.4"
When installing the development package
$ pipenv install --dev flake8
Pipfile
[dev-packages]
flake8 = "*"
I'll do a bundle install ~
$ pipenv install
$ pipenv install --dev #For development
When you want to reproduce the environment from Pipfile.lock
$ pipenv sync
Version upgrade of installed packages
$ pipenv update
Edit Pipfile
by yourself and write as below.
Pipfile
[scripts]
main = "python main.py"
Run scripts
$ pipenv run main
In addition, it can be executed individually without entering the virtual environment.
$ pipenv run python main.py
Do you want to create .venv
under the project directory? ?? ??
So
.bashrc
export PIPENV_VENV_IN_PROJECT=true
After that how to use
$ pipenv shell #Virtual environment
$ exit #Exit
$ pipenv --venv #Virtual environment path
$ pipenv --rm #Delete virtual environment
I think there are people who write more properly, but I have summarized the ones I use for the time being.
To be honest, I've just started Python, so I just researched and summarized it, and I wrote it appropriately, so please think about it like this.
Seriously, you should read and understand the ones you know (oversized boomerang).
It's a little off topic, but isn't it a stable version of WSL2 soon? Use docker ~~
Recommended Posts