Python virtual environment tools¶
Old tools
- Virtualenv
- Supports Python 2
- venv
- In Python 3 stdlib
- Basically the same as virtualenv
New tools
- pipenv
- poetry
- pdm
- Uses the py___.toml
pyenv¶
- Not a virtual environment
- download the right version of python
pipenv
¶
why pipenv
¶
- managed by pypa
- python packaging authority
- same people who manage
- pip
- virtualenv
- wheel
Enter the virtual env¶
Create a virtual env¶
- Install the version of Python you wanna use 2.
pyenv install --list
3. list all version of Pythonpyenv
cn install 4.pyenv install 3.10.6
- Switch to that version of python 6.
pyenv local 3.10.6
- Setup the env with that version of python 5.
pipenv install --python 3.10.6
6.pipenv install
to install with your current version
Create a pipenv
env from requirements.txt
¶
pipenv install
Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
Last update:
2023-04-24