One, use pip to install Python package

Source: Internet
Author: User

one, using pip to install Python packages most newer Python versions come with Pip, so check first to see if the system has PIP installed.    In Python3, Pip is sometimes referred to as PIP3. 1, check if PIP is installed in Linux and OS X system open a terminal window, and execute the following command: Python2.7: [email protected]-k53sj:~$ Pip--version pip8.1.1  from/usr/lib/python2.7/dist-packages (python2.7) python3.x: [Email protected]-k53sj:~$ PIP3--version pip8.1.1  from/usr/lib/python3/dist-packages (python3.5If it does not exist, you need to install PIP in the terminal to install PIP in the command: sudo apt install python-The command for PIP to install PIP3 in the terminal window is: sudo apt install python3-pip two, install Pygame in Linux system if we are using Python2.7, use Package Manager to install Pygame. To do this, open a terminal window and execute the following command, which will download the Pygame and install it into our system: $ sudo apt-GetInstall python-Pygame If we are using Python3, we need to perform two steps: Install the Pygame dependent Library, download and install Pygame. Execute the following command to install the Pygame dependent library (if we are using command Python3 when we start the terminal session.5, replace the Python3-dev with the Python3.5-Dev): $ sudo apt-GetInstall python3-Dev Mercurial $ sudo apt-GetInstall Libsdl-image1.2-dev Libsdl2-dev LIBSDL-TTF2.0-Dev If we need to enable some of the advanced features of Pygame, such as adding sound features, you can install these additional libraries: $ sudo apt-GetInstall Libsdl-mixer1.2-dev libportmidi-Dev $ sudo apt-GetInstall Libswscale-dev Libsmpeg-dev Libavformat-dev libavcodec-Dev $ sudo apt-GetInstall python-NumPy Next, execute the following command to install Pygame (replace PIP with PIP3 if necessary): HG clone https://Bitbucket.org/pygame/pygameCD pygame python3 setup.py build sudo python3 setup.py instal or try $pip install--user hg+http://Bitbucket.org/pygame/pygame if it works.to confirm that the installation was successful, start a Python terminal session and try to import Pygame by executing the following command: $ python3>>>Import Pygame>>>

One, use pip to install Python package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.