Some situations encountered using python under deepin

1. The system comes with python2.7 and python3.5, and the default for running python directly is version 2.7

   Of course, the default version of running python directly can be modified, refer to here

   Then you may need version 3.6, just enter it directly on the command line

   sudo apt install python3.6

   Downloaded here is 3.6.2

   Similarly, change the version number to 2.7 and 3.5 to download the 2.7 and 3.5 versions of python

 

 Use the following command

 python3.6 XX.py

   

 Uninstall with the following command

 sudo apt remove python3.6

   Of course, the 2.7 and 3.5 versions are uninstalled carefully, because there may be dependencies at the bottom of the system

 

2. pip is a tool used to easily download some python packages

   However, different versions of python have different pips.

   The pip installation command for python2.7: sudo apt install python-pip

   The pip installation command for python3.5: sudo apt install python3-pip

   The python3.6 installation comes with pip

   The pip installation toolkit for a specific version (3.6 for example):

   python3.6 -m pip install SomePackage

 Specific reference here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325136386&siteId=291194637