This is the procedure for MacOS Catalina. It supports zsh.
It's a tool for easily switching between Python versions. I don't think I'll be using Python2 these days, but it's nice to be able to easily switch versions within Python3.
It is a tool for managing Python packages.
echo 'export PIPENV_VENV_IN_PROJECT=1' >> ~/.zshrc
. ~/.zshrc
echo $PIPENV_VENV_IN_PROJECT
> 1
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
git clone git://github.com/yyuu/pyenv-update.git ~/.pyenv/plugins/pyenv-update
Add path to ~ / .zshrc
vim ~/.zshrc
.zshrc
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
Reboot the terminal
pyenv update
pyenv --version
> pyenv 1.2.20
This time it is 3.7.4, but please specify the version you like
pyenv install 3.7.4
pyenv global 3.7.4
pyenv versions
> * 3.7.4 (set by /Users/***/.pyenv/version)
Rebooting the terminal Check version
python --version
> Python 3.7.4
pip --version
> pip 19.0.3 from /Users/***/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pip (python 3.7)
pip install --upgrade pip
pip --version
> pip 20.2 from /Users/***/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pip (python 3.7)
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
Add the path to ~ / .zshrc
vim ~/.zshrc
export PATH="$HOME/.poetry/bin:$PATH"
Reboot the terminal
poetry --version
> Poetry version 1.0.10
poetry self update
> You are using the latest version
Add packages here as needed You can skip it
pip install pipenv
pip install awscli
pip install awslogs
Check installed packages Versions are likely to be different
pip freeze
> awscli==1.16.254
> awslogs==0.11.0
> boto3==1.9.244
> botocore==1.12.244
> certifi==2019.9.11
> colorama==0.4.1
> docutils==0.15.2
> jmespath==0.9.4
> pipenv==2018.11.26
> pyasn1==0.4.7
> python-dateutil==2.8.0
> PyYAML==5.1.2
> rsa==3.4.2
> s3transfer==0.2.1
> six==1.12.0
> termcolor==1.1.0
> urllib3==1.25.6
> virtualenv==16.7.5
> virtualenv-clone==0.5.3
When creating a new project
poetry new my-package
When managing an existing project with poetry (You will be asked a lot, but you can just press Enter)
poetry init
Add a package
poetry add [package name]
Install packages from pyproject.toml
poetry install
Update package from pyproject.toml
poetry update
That is all. Thank you for your hard work.
Recommended Posts