简体   繁体   English

如何在python3上安装第三方模块

[英]How to install third-party modules on python3

There are several versions of python on my mac OS X system. 我的Mac OS X系统上有多个版本的python。 I just installed beautiful soup4 on python2.7.6, but how can I install the same module on the version 3.4.3? 我刚刚在python2.7.6上安装了漂亮的soup4,但是如何在版本3.4.3上安装相同的模块?

From the BeautifulSoup Official Documentation : 来自BeautifulSoup官方文档

Beautiful Soup 4 is published through PyPi, so if you can't install it with the system packager, you can install it with easy_install or pip. Beautiful Soup 4是通过PyPi发布的,因此,如果无法使用系统打包程序安装它,则可以使用easy_install或pip安装它。 The package name is beautifulsoup4, and the same package works on Python 2 and Python 3. 程序包名称为beautifulsoup4,该程序包可在Python 2和Python 3上使用。

 $ easy_install beautifulsoup4 $ pip install beautifulsoup4 

You should always use a virtualenv. 您应该始终使用virtualenv。 For each project, install the requirements you need inside that project's own virtualenv. 对于每个项目,在该项目自己的virtualenv中安装所需的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM