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
|
usage
List all available pyenv commands
List all available Python versions
Installing specific Python versions
Uninstall a specific python version
Show all Python versions
Setting the global Python version
Display the currently active Python version
Display the full path to the Python version
Set a shell-specific Python version
Unsets the shell version
Set a local Python version
Unset the local Python version
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
Delete a virtualenv
1
|
$ pyenv virtualenv-delete py377
|
Activate a virtualenv
When you activate a virtulaenv, the virtualenv will override the local virtualenv.
Deactivate the virtualenv
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
Install all packages specified in Pipfile.lock
Install all dependencies including dev
Show a graph of your installed dependencies
Create a lockfile containing pre-releases
Checks for security vulnerabilitie
Uninstall a provided package and removes it from Pipfile
Uninstall all packages not specified in Pipfile.lock
Locate the project
Locate the virtualenv
Remove project virtualenv from current directory
jupyter
install
1
|
pip install ipykernel jupyter jupyter_cms ipython
|