rh-python35 rh-python36 rh-python38
scl enable rh-python38 bash python -V Python 3.8.13 # exitで、元の環境に戻る exit python -V Python 2.7.5
記事:
pyenv install -v 3.6.8 ... ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
sudo apt-get update sudo apt-get install zlib1g-dev libssl-dev pyenv install -v 3.6.8 pyenv local 3.6.8 python3 -V Python 3.6.8
.eggs/importlib_metadata-0.0.0-py3.5.egg
sudo pip3.5 install setuptools --upgrade rm -rf .eggs/importlib_metadata-0.0.0-py3.5.egg
# EPELリポジトリを追加 sudo rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/$(uname -i)/epel-release-5-4.noarch.rpm # python 2.6をインストール(awsを使うなら python26-boto も追加) sudo yum install python26 python26-devel python26-distribute --enablerepo=epel # pipをインストール sudo easy_install-2.6 pip sudo pip2.6 list distribute (0.6.10) pip (1.5.6) setuptools (0.6c11) wsgiref (0.1.2)
yum install python-setuptools python-pip
pip install pytz # バージョンを指定してインストール pip install pytz==2013.7
pip install --upgrade pytz
pip freeze > packages.txt
pip install -r packages.txt
python -V Python 2.6.6 sudo yum install python-devel python-setuptools python-tools python-pip sudo pip install virtualenv virtualenvwrapper vim ~/.bashrc ---- if [ -f /usr/bin/virtualenvwrapper.sh ]; then export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python export WORKON_HOME=$HOME/.virtualenvs source /usr/bin/virtualenvwrapper.sh fi ---- source ~/.bashrc # pipインストール時に"bz2 module is not available"エラーが出るため sudo yum install bzip2-devel # python 2.7.6をインストールする場合(3.3.4も同様) wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz tar xvfz Python-2.7.6.tgz cd Python-2.7.6 ./configure --prefix=/usr/local --with-bz2 make sudo make altinstall # 仮想環境作成 mkvirtualenv -p /usr/local/bin/python2.7 py27 ... python -V Python 2.7.6 # install等、自由に作業 # 無効化 deactivate # 有効化(オプション無しで環境一覧) workon py27 # 環境削除 rmvirtualenv py27
yum install python27 python27-devel python27-tools python27-distribute easy_install-2.7 pip which python2.7 pip /usr/bin/python2.7 /usr/bin/pip
sudo easy_install -mxN pip sudo rm -rf /usr/lib/python2.4/site-packages/pip-1.5.6-py2.4.egg sudo rm -f /usr/bin/pip