Source:
Related Pages: use hbase
yum install gcc openssl-devel bzip2-devel sqlite-devel libsqlite3x-devel #required for build
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
tar xzf Python-3.6.9.tgz
cd Python-3.6.9
./configure --enable-optimizations
make altinstall #altinstall will preserve current installed version(s)
rm -rf Python-3.6.9* #remove downloaded source codes. Its maintained in /usr/local/lib
python3.6 -V #verify
Tested Steps on Centos-6.5: directly jump to pip install happybase if python already installed.
yum -y update
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel sqlite sqlite-devel openssl-devel
wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
xz -d Python-2.7.13.tar.xz
tar xf Python-2.7.13.tar
cd Python-2.7.13
./configure --prefix=/usr/local #use --
make install #use altinstall instead if you want to maintain installed python version
wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
python2.7 get-pip.py
pip2.7 install happybase
python2.7 -c "import happybase" #to test
---------------------------------------------Errors-----------------
http://stackoverflow.com/questions/37723236/pip-error-while-installing-python-ignoring-ensurepip-failure-pip-8-1-1-requir/37723517
Ubuntu
apt-get install make build-essential libssl-dev zlib1g-dev libbz2-dev libsqlite3-dev
CentOS
yum install zlib-devel bzip2-devel sqlite sqlite-devel openssl-devel
Errors: while installing scrapy:
fatal error: openssl/opensslv.h: No such file or directory
sudo apt-get install python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev
sudo pip install mitmproxy
pip install autopep8 #Required for auto formatting of code. Python extension for visual studio code uses this for formatting feature.
Sources: tecadmin.net
#Case where multiple python version are there and you don't know consequences of installing various modules.
1. on terminal type python and hit TAB TAB, to list all available python. same can be done with pip.
2. pip -V #check at last to which python, pip is pointing to
3. pip install virtualenv
4. virtualenv ENV ##use -p python<VERSION> to load environment with specific python version.
5. cd ENV
6. source ./bin/activate #To end environment just type deactivate and hit enter.
7. cd <PROJECT_FOLDER> #This & following 2 steps are project specific...
8. pip install -r server/requirement.txt
9. pip install scrapy scrapyrt # if scrapy is required
##in windows powershell we need to perform following after above step-4 to activate environment.
4.a - start powershell as administrator
4.b- execute Set-ExecutionPolicy Unrestricted
4.c- ENV/scripts/activate.ps1
virtualenv pyboto
cd pyboto
source ./bin/activate
pip install boto #tested for python 2.7