Environment: Just reinstalled the system, it is Ubuntu 16.04
Purpose: Install Python3.x, install 3.5.2 in this example
step:
Problem 1: When executing sudo make install, you may encounter an error, similar to zipimport.ZipImportError: can't decompress data, lack of zlib. So start another terminal: sudo apt-get update. Not enough, enter update in the Ubuntu search box , Select Software Updater, it will automatically check to update, if it prompts that there is software that needs to be updated, click update to restart the computer to take effect. At this point, sudo apt-get install zlib can be installed successfully, and then sudo make install can also be successful.
Question 2: At this time python --version, the system still returns to the 2.7 version. However you want to use the 3.x version
Solution steps:
At this time, python --version will prompt python 3.x
Problem 3: Installing sudo apt-get install python-pip will report an error: ImportError: No module named'pip'; installing sudo apt-get install python-setuptools is successful, but easy_install --version will report an error: pkg_resources.DistributionNotFound
Solution steps:
Then easy_install --version; pip --version will return the version number.
Recommended Posts