Clean python environment with pythonz and virtualenv

Install the required packages

apt-get -y update
apt-get -y upgrade
apt-get -y install python
apt-get -y install python-setuptools
apt-get -y install python-pip
apt-get -y install python-virtualenv

Install Pythonz

cd ~
curl -kL https://raw.github.com/saghul/pythonz/master/pythonz-install | bash
echo '[[ -s $HOME/.pythonz/etc/bashrc ]] && source $HOME/.pythonz/etc/bashrc' >> ~/.bashrc
source ~/.bashrc

Install python with pythonz

You can install any version you like. Install the latest 2 series for the time being

pythonz install 2.7.5

virtualenv settings

virtualenv -p ~/.pythonz/pythons/CPython-2.7.5/bin/python ~/.pythonz/virtualenv/Python-2.7.5
echo 'PATH=$HOME/.pythonz/virtualenv/Python-2.7.5/bin:$PATH' >> ~/.profile
source ~/.profile

Set the Python character code to UTF-8

cd ~/.pythonz/virtualenv/Python-2.7.5/lib/python2.7/site-packages
touch sitecustomize.py
echo 'import sys' >> sitecustomize.py
echo 'sys.setdefaultencoding("utf-8")' >> sitecustomize.py
```

 With Pythonz + virtualenv, you will be able to manage versions and packages without polluting the global python environment.

Recommended Posts

Clean python environment with pythonz and virtualenv
Building a python environment with virtualenv and direnv
Manage python environment with virtualenv
Manage Python multiple version environment with Pythonz, virtualenv
Build a python virtual environment with virtualenv and virtualenvwrapper
Build a python virtual environment with virtualenv and virtualenvwrapper
Build python virtual environment with virtualenv
Build Python development environment (pythonz, virtualenv, direnv)
Python environment with docker-compose
Virtual environment with Python 3.6
Python3 TensorFlow environment construction (Mac and pyenv virtualenv)
Recommended environment and usage when developing with Python
python development environment -use of pyenv and virtualenv-
Commands for creating a python3 environment with virtualenv
Work in a virtual environment with Python virtualenv.
Build PyPy and Python execution environment with Docker
Programming with Python and Tkinter
Encryption and decryption with Python
Create an environment with virtualenv
Python and hardware-Using RS232C with Python-
Install Python environment with Anaconda
Build python3 environment with ubuntu 16.04
Prepare python3 environment with Docker
Build python environment with direnv
Python environment construction and TensorFlow
Manage Python runtime packages and development environment packages with Poetry
Specify python version with virtualenv
Works with Python and R
Get a clean Python development environment with pyenv + pipx + Poetry
Install CaboCha in Ubuntu environment and call it with Python.
Communicate with FX-5204PS with Python and PyUSB
Shining life with Python and OpenCV
Get started with Python! ~ ① Environment construction ~
Install Python 2.7.9 and Python 3.4.x with pip.
Neural network with OpenCV 3 and Python 3
AM modulation and demodulation with python
[Python] font family and font with matplotlib
Scraping with Node, Ruby and Python
Setup modern Python environment with Homebrew
Scraping with Python and Beautiful Soup
Build Mysql + Python environment with docker
JSON encoding and decoding with python
Building a virtual environment with Python 3
Use rospy with virtualenv in Python3
Hadoop introduction and MapReduce with Python
[GUI with Python] PyQt5-Drag and drop-
Reading and writing NetCDF with Python
I played with PyQt5 and Python3
Reading and writing CSV with Python
Multiple integrals with Python and Sympy
pytorch @ python3.8 environment construction with pipenv
Prepare Python development environment with Atom
Coexistence of Python2 and 3 with CircleCI (1.0)
Easy modeling with Blender and Python
When using MeCab with virtualenv python
Sugoroku game and addition game with python
FM modulation and demodulation with Python
Environment construction with pyenv and pyenv-virtualenv
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Build a Python environment on your Mac with Anaconda and PyCharm
Install pip in Serverless Framework and AWS Lambda with Python environment