Install Python in Ubuntu

Source: Internet
Author: User
Tags install matplotlib

Compiling the installation from source code
    • Download the latest version from the Python website
    • Unzip tar -xzvf Python-3.6.4.tgz , modify the package name according to the version number
    • cd Python-2.7.9/
    • LDFLAGS="-L/usr/lib/x86_64-linux-gnu" ./configure
    • make
    • sudo make install
Error
zipimport.ZipImportError: can‘t decompress data; zlib not availableMakefile:1099: recipe for target ‘install‘ failedmake: *** [install] Error 1

Reason:
Related Toolkit for missing zlib
Solve:

    1. Install zlib dependent packages: yum -y install zlib* orsudo apt-get install zlibc zlib1g-dev
    2. To the Python installation directory to execute thesudo ./configure
    3. To enter the Python installation package, modify the setup file for the module path:vim module/setup
      Find a line of code:
      #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
      Remove Comments:
      zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
      After installing the above dependency package, re-enter the terminal and proceed to Python's installation package path:
      make && make install
      Recompile the installation
      If you encounter permissions problems, precede the command by addingsudo
Install Paint Packages
apt-get install python-pippip install numpypip install matplotlib

Install Python in Ubuntu

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.