Setuptools 18.4 from /usr/local/lib/python2.7/site-packages/setuptools-18.4-py2.7.egg (Python bin]$ pip2.7 -version Pip 7.1.2 from /usr/local/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg (python bin]$ easy_install -version bin]$ which bin]$ which bin]$ pip -version On this system, it’s because /usr/local/bin comes before /usr/bin.
I think if root uses pip or easy_install it will install into python 2.7, not 2.6 maybe that doesn’t matter. On this system they did: ~]$ cd bin]$ ls -ltr pip* Check first though if pip and easy_install act right after install. I had to rename pip and easy_install in /user/local/bin and create links. Sudo /usr/local/bin/easy_install-2.7 paramiko Sudo /usr/local/bin/easy_install-2.7 psutil Sudo /usr/local/bin/easy_install-2.7 requests rwxr-xr-x 1 root root 326 Oct 24 13:52 /usr/local/bin/easy_install ~]$ which ~]$ which ~]$ ls -ltr /usr/local/bin/easy_install* Pay attention to /usr/local/bin vs /usr/bin. I’m jumping between two different machine installs here, sorry about that, If this method to install the setuptools does not work, you can follow the link. You should be able to use “easy_install” if “which easy_install” points to the correct 2.7 versions. Use this script to install packages for your new Python version. The commands above will generate the script /usr/local/bin/easy_install-2.7. Sudo /usr/local/bin/python2.7 ez_setup.py > Installing and configuring distribute (setuptools):Īfter installing Python 2.7.6 you also need to install distribute (setuptools) so you can easily install new packages in the right location. Type "help", "copyright", "credits" or "license" for more information. sudo ln -s /usr/local/bin/python2.7 bin]$ which bin]$ python If root is pointing to /usr/local/bin/python, remove the link you just added, and figure out something else. If you add this link, do a “which python” for the user and for root.
usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin if it has /usr/local/bin before /usr/bin, it will see python2.7 first i.e. WARNING: don’t do this before checking the $PATH for root. If things don’t look right, you might need to create a symbolic link in /usr/local/bin: cd /usr/local/bin Lrwxrwxrwx 1 root root 6 16 août 17:26 /usr/bin/python2 -> Python-2.7.6]$ ls -ltr /usr/local/bin/python* LDFLAGS="-R /usr/local/lib" Check with: Python-2.7.6]$ ls -ltr /usr/bin/python* Onfigure: WARNING: you should use –build, –host, –targetĬonfigure: WARNING: invalid host type: –enable-sharedĬonfigure: error: invalid variable name: `–prefix’ configure –enable-shared –prefix=/usr/local LDFLAGS="-Wl,–rpath=/usr/local/lib" Add that some python libraries (such as Theano) require a dynamic library: sudo. (Depending on your version of wget, you may need to add the –no-check-certificate option to the wget command line.)Īfter running the commands above your newly installed Python 2.7.6 interpreter will be availableĪs /usr/local/bin/python2.7 and the system version of Python 2.6.6 will be available as /usr/bin/python and /usr/bin/python2.6.
Python in the filesystem both named python. It is important to use altinstall instead of install, otherwise you will end up with two different versions of
The –no-check-certificate is optional cd /opt Or else you will run into problems later when trying to install various packages: sudo yum install zlib-devel You also need a few extra libs installed before compiling Python In order to compile Python you must first install the development tools sudo yum groupinstall "Development tools" To check centos version: bin]$ cat /etc/redhat-release Here are the steps necessary to install Python 2.7.6. If you need access to a newer version of Python you must compile it yourself and install it side-by-side with the system version. Be careful not to replace it or bad things will happen. Follow this sequence exactly for centos machine onlyĬentOS 6.7 ships with Python 2.6.6 and depends on that specific version.