![]() ![]() Installing pip2.7 script to /usr/local/bin Installing pip for Python 2.7: # easy_install-2.7 pip Processing dependencies for setuptools=19.4įinished processing dependencies for setuptools=19.4 Installed /usr/local/lib/python3.5/site-packages/setuptools-19.4-p圓.5.egg Install setuptools for Python 3.5: # python3.5 ez_setup.py ![]() Install setuptools for Python 2.7: # python2.7 ez_setup.py Instead use the below command to install pip2.7. Update: The above command will fail with not found error. (or) # curl | /usr/local/bin/python2.7 You're using an outdated location for the get-pip.py script, please use the one available from Let’s now install setuptools and pip for both the Python versions (2.7 and 3.5) we installed above: # wget # ls -ld /usr/local/lib/python3.5/ Install Setuptools and Python Pip: Successfully installed pip-7.1.2 setuptools-18.2 Python 3.5 installed: Installing collected packages: setuptools, pip configure -prefix=/usr/local -enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib" The Python 2.7 is installed under: # ls -ld /usr/local/lib/python2.7/ Compile and Install Python 3.5 on CentOS # wget # tar xz Python-3.5.1.tar.xz # cd Python-3.5.1 #. Note: Lookout for make altinstall – you should never use ‘make install’ as it will install both the versions on the same file-system and will mess up python. Rm /usr/local/lib/python2.7/lib-dynload/_sysconfigdata.py* Writing /usr/local/lib/python2.7/lib-dynload/Python-2.7.6-py2.7.egg-info # make & make altinstallĬopying build/scripts-2.7/idle -> /usr/local/binĬopying build/scripts-2.7/smtpd.py -> /usr/local/binĬopying build/scripts-2.7/pydoc -> /usr/local/binĬopying build/scripts-2.7/2to3 -> /usr/local/binĬhanging mode of /usr/local/bin/idle to 755Ĭhanging mode of /usr/local/bin/smtpd.py to 755Ĭhanging mode of /usr/local/bin/pydoc to 755Ĭhanging mode of /usr/local/bin/2to3 to 755 It means, the executable will be installed in /usr/local/bin and libraries in /usr/local/lib. Note: I’ll be installing Python in /usr/local. # cd Python-2.7.6 #./configure -prefix=/usr/local -enable-unicode=ucs4 -enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"Ĭonfig.status: creating Modules/nfigĬonfig.status: creating Modules/ld_so_aix In case, if you couldn’t extract using tar, then here’s a guide to help you out. Note: The latest version of tar is capable of extracting. #yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-develĬomplete! Compile and Install Python 2.7 on CentOS 6.4ĭownload Python 2.7: # wget # tar xf Python-2.7.6.tar.xz These libraries are not must to install Python, but you may need those at a later stage. Install Development Tools: #yum groupinstall "Development tools" Get the system ready to setup Python by installing “Development Tools” and necessary libraries. Prerequisites: You need root access or sudo privilege. Note: Always install new version of Python in a non-standard location (such as /usr/local/) It means, if you ever want to install multiple versions of Python on a single machine, then do it in a right way! So, the lesson learnt is – Never mess up with Python!! (Once the Python is broken, it’s very hard to fix). ImportError: No module named pkg_resources Type "help", "copyright", "credits" or "license" for more information.įrom pkg_resources import load_entry_point Python failed to import yum after installing/upgrading Python: # python Verify that the module is installed correctly. Please install a package which provides this module, or There was a problem importing one of the Python modules Well, the main reason behind this tutorial is – I recently installed Python 3 and broke everything – python, pip, yum etc…Here’s the snapshot of those: yum broke after installing/upgrading Python: # yum And we are going to do this without breaking the existing Python installation (the default system installed version is 2.6.6 on CentOS 6.4) and other system tools such as yum. Today, I’m going to tell you how to install Python 2.7 and 3.5 versions on CentOS 6.4. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |