個人常用:
pip install virtualenv
virtualenv -p /usr/bin/python2.7 --no-site-packages env_ansible
source env_ansible/bin/activate
#env_ansible\scripts\activate #on windows
pip list
deactivate
python-3.5.2 安裝:
# yum install openssl-devel
keyutils-libs-devel krb5-devel libcom_err-devel libselinux-devel libsepol-devel zlib-devel e2fsprogs
e2fsprogs-libs keyutils-libs krb5-libs libcom_err libselinux libselinux-python libselinux-utils libss
-- 安裝 python-3.5.2
# cd /usr/local/src/
# ls /usr/local/src/python-3.5.2.tgz
# tar -zxvf python-3.5.2.tgz
# mkdir /usr/local/python35
# cd /usr/local/src/python-3.5.2
# ./configure --prefix=/usr/local/python35
# make && make install
-- 設定環境變數
# vi /etc/profile
path=$path:/usr/local/python35/bin
# source /etc/profile
-- 設定預設連線版本
# cd /usr/bin/
# ll /usr/bin/python*
# rm -rf /usr/bin/python
# ln -s /usr/local/python35/bin/python3.5 /usr/bin/python
-- 檢視版本或進入 pythone
# python -v
# python
# 安裝完 python 後, yum 使用可能出錯
# yum
file "/usr/bin/yum", line 30
except keyboardinterrupt, e:
^syntaxerror: invalid syntax
# 解決方法:
# ll /usr/bin/python*
# vi /usr/bin/yum
第一行 「#!/usr/bin/python」 改為 「#!/usr/bin/python2.6」
-- 安裝 easy_install(setuptools-28.8.0.tar.gz)
--
# ll /usr/local/src/setuptools-28.8.0.tar.gz
# cd /usr/local/src
# tar -zxvf setuptools-28.8.0.tar.gz
# cd /usr/local/src/setuptools-28.8.0
# python setup.py install
# ln -s /usr/local/python35/bin/easy_install /usr/bin/easy_install
# easy_install --version
-- 安裝 pip(pip-9.0.1.tar.gz)
--
# ll /usr/local/src/pip-9.0.1.tar.gz
# cd /usr/local/src
# tar -zxvf pip-9.0.1.tar.gz
# cd /usr/local/src/pip-9.0.1
# python setup.py install
# ln -s /usr/local/python35/bin/pip /usr/bin/pip
# pip --version
-- 安裝 wheel(wheel-0.30.0a0.tar.gz)
--
# ll /usr/local/src/wheel-0.30.0a0.tar.gz
# cd /usr/local/src
# tar -zxvf wheel-0.30.0a0.tar.gz
# cd /usr/local/src/wheel-0.30.0a0
# python setup.py install
# ln -s /usr/local/python35/bin/wheel /usr/bin/wheel
# wheel version
-- 安裝 virtualenv(virtualenv-15.1.0.tar.gz)
--
# ll /usr/local/src/virtualenv-15.1.0.tar.gz
# cd /usr/local/src
# tar -zxvf virtualenv-15.1.0.tar.gz
# cd /usr/local/src/virtualenv-15.1.0
# python setup.py install
# ln -s /usr/local/python35/bin/virtualenv /usr/bin/virtualenv
# virtualenv --version
--解除安裝(python setup.py install 方式安裝)
python setup.py install --record files.txt
cat files.txt | xargs rm -rf
#安裝setuptools
wget --no-check-certificate
python ez_setup.py --insecure
#安裝pip
wget --no-check-certificate
python get-pip.py
python3 5 2內建函式
內建函式 abs dict help min setattr all dir hex next slice any divmod id object sorted ascii enumerate input oct staticmethod bin eval int open str bool ex...
Python3 52安裝擴充套件錯誤
importerror no module named setuptools 這句錯誤提示的表面意思是 沒有setuptools的模組,說明python缺少這個模組,那我們只要安裝這個模組即可解決此問題,下面我們來安裝一下 如果需要就加上 no check certificate引數 wget no...
Linux Ubuntu 相關工具及配置
1.網路配置 sudo vim etc network inte ces 編輯以下資訊,設定靜態ip位址 auto eth0 iface eth0 inet static address 192.x.x.x netmask 192 broadcast x gateway xx dns nameser...