requirement

1
2
3
4
5
6
7
8
sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev

sudo apt-get install lzma
sudo apt-get install liblzma-dev
sudo apt-get install libbz2-dev

sudo apt-get install python3-tk

pyenv

what is pyenv

pyenv is for a Python version management + virtual environment tool.

install pyenv

1
curl https://pyenv.run | bash

pyenv

1
2
3
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
1
source ~/.bashrc

usage

List all available pyenv commands

1
pyenv commands

List all available Python versions

1
pyenv install -l

Installing specific Python versions

1
pyenv install 3.12.0

Uninstall a specific python version

1
pyenv uninstall 3.12.0

Show all Python versions

1
pyenv versions

Setting the global Python version

1
pyenv global 3.12.0

Display the currently active Python version

1
pyenv version

Display the full path to the Python version

1
pyenv which python

Set a shell-specific Python version

1
pyenv shell  3.12.0

Unsets the shell version

1
pyenv shell --unset

Set a local Python version

1
pyenv local 3.11.5 

Unset the local Python version

1
pyenv local --unset  

install pyenv-virtualenv

install pyenv-virtualenv

1
2
3
$ git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
$ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
$ source ~/.bashrc

pyenv-virtualenv

usage

Create a virtualenv by specifying the Python version with the name of the virtualenv directory

1
2
# Create a virtualenv called py377 using Python 3.7.7
$ pyenv virtualenv 3.7.7 py377

Set local virtualenv

1
2
3
4
# Set a local(direcotry) python environment to 377
$ pyenv local py377
(py377)$ cat .python-version
py377

Remove a local virtualenv

1
$ rm .python-version

Delete a virtualenv

1
$ pyenv virtualenv-delete py377

Activate a virtualenv

1
$ pyenv activate py377

When you activate a virtulaenv, the virtualenv will override the local virtualenv.

Deactivate the virtualenv

1
pyenv deactivate

pipenv

what is pipenv

pipenv is a Python package management and virtual environment tool.

install

1
python -m pip install pipenv

pipenv

usage

Create a new virtualenv

1
pipenv  --python 3.11.5 install

Installing packages

1
pipenv install eth-ape'[recommended-plugins]'

Produces a command within the virtualenv

1
pipenv shell 

Install all packages specified in Pipfile.lock

1
pipenv sync

Install all dependencies including dev

1
pipenv install --dev

Show a graph of your installed dependencies

1
pipenv graph

Create a lockfile containing pre-releases

1
pipenv lock --pre

Checks for security vulnerabilitie

1
pipenv check

Uninstall a provided package and removes it from Pipfile

1
pipenv uninstall 

Uninstall all packages not specified in Pipfile.lock

1
pipenv clean

Locate the project

1
pipenv --where

Locate the virtualenv

1
pipenv --venv

Remove project virtualenv from current directory

1
pipenv  --rm

jupyter

install

1
pip install ipykernel jupyter jupyter_cms ipython