Steps to install Python environment on Ubuntu

Install pyenv

zsh

git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
source ~/.zshrc

bash

git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc

For copy

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

python installation

pyenv install 3.4.3
pyenv rehash

By the way, there is also a pyenv plugin that automatically does rehash.

Install pyenv-virtualenv

zsh

git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc
echo 'export VIRTUAL_ENV_DISABLE_PROMPT=1' >> ~/.zshrc
source ~/.zshrc

bash

git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
echo 'export VIRTUAL_ENV_DISABLE_PROMPT=1' >> ~/.bashrc
source ~/.bashrc

For copy

eval "$(pyenv virtualenv-init -)"
export VIRTUAL_ENV_DISABLE_PROMPT=1

Creating a virtualenv

pyenv virtualenv 3.4.3 my_application-3.4.3

Apply virtualenv

Directly under the project directory

pyenv local my_application-3.4.3

Dependency output

Directly under the project directory

pip freeze > requirements.txt

Dependency installation

Directly under the project directory

pip install -r requirements.txt

Recommended Posts

Steps to install Python environment on Ubuntu
Steps to install python3 on mac
Install Python 3.3 on Ubuntu 12.04
Install python package in personal environment on Ubuntu
Install OpenCV on Ubuntu + python
Steps to install the latest Python on your Mac
Install Python 3.8 on Ubuntu 18.04 (OS standard)
Steps to install MySQL 8.0 on CentOS 8.1
Prepare Python development environment on Ubuntu
Building a Python environment on Ubuntu
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Install python2.7 on windows 32bit environment
Steps to install matplotlib on Mac
Steps to install Ubuntu in VirtualBox
Install Python 3.9 on Ubuntu 20.04 (OS standard?)
Install Python development environment on Windows 10
Install confluent-kafka for Python on Ubuntu
Install Python 2.7 on Ubuntu 20.04 (OS standard?)
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
How to install Go on Ubuntu
OpenCV3 & Python3 environment construction on Ubuntu
How to build a new python virtual environment on Ubuntu
Build Python3 and OpenCV environment on Ubuntu 18.04
[Kivy] How to install Kivy on Windows [Python]
Python virtual environment and packages on Ubuntu
Created Ubuntu, Python, OpenCV environment on Docker
Install python on xserver to use pip
How to install php7.4 on Linux (Ubuntu)
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
Install TensorFlow on Ubuntu
Install python on WSL
How to install Python
Install Python on Pidora.
Install Scrapy on python3
Install Python on Mac
How to install python
Install Python 3 on Mac
Install PySide2 on Ubuntu
Install Python3.4 on CentOS 6.6
Install JModelica on Ubuntu
Install python on windows
Install Python 2.7.3 on CentOS 5.4
build Python on Ubuntu
Install Python 3.4 on Mac
Install Theano on Ubuntu 12.04
Install angr on Ubuntu 18.04
Install pip / pip3 on Ubuntu
Install Python 3.6 on Docker
[2020 version] How to install Python3 on AWS EC2
Build python environment with pyenv on EC2 (ubuntu)
Build Python3.5 + matplotlib environment on Ubuntu 12 using Anaconda
How to install OpenCV on Jetson Nano Python
[Latest] How to build Java environment on Ubuntu
[Procedure memo] Install Python3 + OpenSSL locally on Ubuntu
How to run MeCab on Ubuntu 18.04 LTS Python
[Venv] Create a python virtual environment on Ubuntu
[Python] How to install OpenCV on Anaconda [Windows]
How to build Java environment on Ubuntu (Linux)
Install MongoDB on Ubuntu 16.04 and operate via python
Steps to create a Python virtual environment with VS Code on Windows