<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Install Python locally on shared Linux server !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/37505/install-python-locally-on-shared-linux-server?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/37505/install-python-locally-on-shared-linux-server?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/37505/install-python-locally-on-shared-linux-server</guid>
	<pubDate>Tue, 07 Aug 2018 06:13:25 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/37505/install-python-locally-on-shared-linux-server</link>
	<title><![CDATA[Install Python locally on shared Linux server !]]></title>
	<description><![CDATA[<code>#Install python to local directory
#Firstly, I create a folder in my home directory, download the python source and extract it

mkdir ~/python      
cd ~/python
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz
tar zxfv Python-2.7.11.tgz
find ~/python -type d | xargs chmod 0755
cd Python-2.7.11

#Then I compiled the source following its guideline

./configure --prefix=$HOME/python
make &amp;&amp; make install

#Notice the prefix option, it is mandatory for this to work. The value of prefix option is to specify where to put the #related output of make command, by default it is in the /usr/local/ and we don&#039;t want that so we use our own #customized directory.

#Here comes another important step. By the default, if we type python command, it will use the default python of #the system. We are going to update the environment variables to force the shell to use our new python. Edit #~/.bashrc_profile and add the following lines:

export PATH=$HOME/python/Python-2.7.11/:$PATH
export PYTHONPATH=$HOME/python/Python-2.7.11

#Finally, refresh the current session by running the command:

source ~/.bashrc_profile

#You might need to logout and login again for the environment to update properly. At this point, you should be #able to see a new python. To check, run this command:

which python
#it should show you the path to the python binary file, which is located in your home directory: ~/python/Python-#2.7.11/python

Install pip

#Pip is a program used to help us easily install python packages After installing python locally as described in #the first step, it is very easy to install pip.

#Run the following command to install pip as a local user

wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py -O - | python - --user

#After finishing the installation, we need to update our PATH variable. Open ~/.bashrc_profile and add the #following line:

export PATH=$HOME/.local/bin:$PATH
#Again, reload the session by the command source ~/.bashrc_profile or logout and login. Then, check if pip #command is available:

which pip
#It should show a path pointing to your local directory: ~/.local/bin</code>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>