Install third-party libraries for different versions of python under Linux

高洛峰
Release: 2017-02-27 16:42:15
Original
1958 people have browsed it

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!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template