Setting up your Python Environment

Pyenv

Pyenv a the project you can use to control the Python’s version. More often than not issues can arise when moving to different versions of Python. For example, from 3.7 to 3.9 there are significant features that can be used that do not exist in older versions.

curl https://pyenv.run | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
pyenv install 3.9.2
pyenv versions
pyenv global 3.9.2
~/.pyenv/versions/3.9.2/bin/python

Pipenv

Documentation

pyenv global 3.9.2
pip install pipenv
mkdir my_project
cd my_project
pipenv --python 3.9.2 install
pipenv lock
[dev-packages]
pipenv install --dev
# or
pipenv shell --dev
pipenv lock
[[source]]
#url = "your pypi url for packages"
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pandas = "==0.24.2"
requests = "*"
[requires]
python_version = "3.9"
pipenv sync 
$ pipenv install requests~=1.2
pipenv run python3 my_python_app.py
pipenv shell
pipenv update --outdated
pipenv update
pipenv update pandas
pipenv install -r requirements.txt
pip freeze > requirements.txt

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store