https://www.youtube.com/watch?v=zDYL22QNiWk&t=151s
pip3 install pipenv
pipenv install package_name
pipenv shell
exit
python --version
python
- import sys
- sys.executable
- quit()
pipenv run python or pipenv run python script.py
pipenv install -r location/to/requirement.txt
pipenv lock -r
pipenv lock -r > requirement.txt
pipenv install package_name --dev
pipenv uninstall package_name
Example change the version of python_version - Open pipfile and change the version (3.7 > 3.6) - recreate the environment by runnning pipenv --python 3.6
pipenv --rm
pipenv install
pipenv --venv
pipenv check
- change the version in the pipfile
- run [pipenv install]
pipenv graph
pipenv lock
pipenv install --ignore-pipfile
-Update pipfile.lock file: [pipenv lock] -Push pipfile.lock for production -Recreate the virtual environment from pipfile.lock file pipenv install --ignore-pipfile
- create a .env file within the project
- add the variabale to be accessible within the environment SECRET_KEY="MySuperSecretKey"
- Check the environment variabale
pipenv run python
- import os
- os.environ['SECRET_KEY']