akpcleveland.blogg.se

Install python3 centos
Install python3 centos




install python3 centos

There’s no need to keep the tar file and the source code around.

install python3 centos

Type "help", "copyright", "credits" or "license" for more information. You can even run your local $ python3 Python 3.3.2 (default, Sep 26 2013, 15:30:36) When you open a new terminal window, or log off and then log on, or (even better) run source ~/.bashrc, you can run the following commands to see that your local Python is now on your $ which python3.3 $ which python3 $ which python /usr/bin/python This is so that our local Python is always used before any $ echo "export PATH=\$HOME/usr/local/bin:\$PATH" > ~/.bashrc Notice that we add the new path before existing $PATH. Now add this path to your $PATH environment variable. This is optional but I like to do it because I can then use python to refer to the Python that came with CentOS and python3 to refer to my locally installed $ ln -s python3.3 python3 Change directory to where local Python binary is $ cd ~/usr/local/binĬreate an alias so you can refer to it as python3. You now want to add ~/usr/local/bin to your $PATH so you don’t have to enter the full path to the Python binary every time you want to use it. Change directory to the un-tar’ed source $ cd Python-3.3.2Ĭreate a directory where you will install your local $ mkdir -p ~/usr/localĬompile and install Python to the directory you just $ make altinstall prefix=$HOME/usr/local exec-prefix=$HOME/usr/local Modify your $PATH You now have Python source and tools to compile it. You should see these two items in your home $ ls Python-3.3.2 Python-3.3.2.tar.bz2 Compile and Install Python Now just un-tar the file so you can use its $ tar xvf Python-3.3.2.tar.bz2 Head over to and download the version you want to install. You also need some libraries that Python uses to provide “batteries included” $ su -c 'yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel' Download Python Source Code The easiest way to obtain them in CentOS is to install the ‘Development Tools’ $ su -c 'yum groupinstall "Development Tools"' You will need some tools to compile Python.

install python3 centos

This is a good alternative especially since Python3 is not officially available in CentOS 6.4.

  • You want to run multiple versions of Python not available on your systemįor whatever the reasons you want to install Python locally in your home directory, it’s not as difficult as I had first thought it to be.
  • You want to run your private/personal scripts without affecting other users on the system.
  • You don’t want to touch the system-installed Python.
  • First off, why would you want to install local Python 3? There could be many reasons, some of which may be:






    Install python3 centos