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. To test if the Python is working fine, write your first hello world program on Python interpreter prompt.Today, I’m going to tell you how to install Python 2.7 and 3.5 versions on CentOS 6.4. Run a command… python -version Hello World Program on Python Prompt You can write your Python code in Python interpreter prompt.ĭo you want to check the Python version installed on your system? It opens Python 3 version interpreter prompt. It opens Python 2 version interpreter prompt. Interestingly, you can download both Python 2 and Python 3 versions on your single system. Meanwhile, you can have coffee for you as it may take some time to install. If you are not root user, you should use sudo keyword every time installing Python package on your Linux system. Redhat / RHEL / CentOS Linux User should run the following command to install Python. Yum Package Manager (Redhat / RHEL / CentOS) It installs the latest Python version for both Python 3 and Python 2. Installing Python 2: $ sudo dnf install python2 Installing Python 3: $ sudo dnf install python3 DNF Package Manager (Fedora)įedora has a default DNF package manager for installing and managing packages in Linux. Make a habit of updating installed packages before installing any new package (First command mentioned above). Note: There can be multiple dependencies among packages installed on Linux. If you want to install Python 2 version, run following commands… $ sudo apt-get update To install Python in these Linux distribution, Open terminal and run command those are given below. Ubuntu and Linux Mint distributions use APT for package management. APT package manager (Debian / Ubuntu / Linux Mint) ![]() There are different package manager used by the different Linux distribution.īased upon type of Linux distribution you are using, check the following commands to install latest Python version. To install any package on Linux, you need to use a specific command based on the package manager. ![]() ![]() Let’s see how to install Python on each Linux distribution, individually. Or you can skip downloading it if you have internet connection to your Linux system where you want to install Python.Īs we all know, there are various flavors of Linux such as Ubuntu, Fedora, Linux Mint, CentOS… And each one of the Linux distribution has a particular package manager.ĭepending on the package manager, you need to follow commands to install Python on Linux. You can download Python package from their official website. In recent, Instagram is migrated from Python 2 to Python 3, successfully. To update you, many of the giant companies are moving to Python 3. In this tutorial, I will be covering the installation of both versions. In the previous article, I have described all the steps to be followed to install Python on the Windows system. In this article, I am sharing all the commands you should run to install Python on Linux, including various Linux distributions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |