Home > Article > Backend Development > Install third-party libraries for different versions of python under Linux
Problem Background
On the current Linux distributions, there are many installed two versions of python.
The default version on my machine is python 2.x. And when using easy_install to install a third-party library, it is also installed on the 2.x version by default. In the 3.x version, the installed library cannot be imported.
Environment: Kubuntu 15.04
Solution
Install python3-setuptools and easy_install3, and install pip3
sudo apt-get install python3-setuptools
sudo easy_install3 pip
sudo pip3 install pyserial (replace pyserial with the required third-party library)
Again in Test the import in python3.x environment and get it done.
Isn’t the method very simple? I searched for it on the Internet for a long time and only completed it under the prompts of a foreign netizen. I hope everyone can like it
More different versions of python under Linux For articles related to installing third-party libraries, please pay attention to the PHP Chinese website!