如何在安装Python 3.4的同时安装BeautifulSoup4 for Python 2.7?

时间:2016-03-11 13:05:01

标签: python windows python-2.7 bs4

我的Windows 8.1系统上安装了Python 2.7.11和Python 3.4.1。我用pip安装 $this->{$this->modelClass}->virtualFields['time_epoch'] = "UNIX_TIMESTAMP(time_seen)"; // Add this $this->{$this->modelClass}->find('all', $parameters); ... 来运行代码(不是我的代码)。但是,pip自动将bs4安装到Python 3.4.1。 (我检查它是否安装在BeautifulSoup4

我已经使用命令提示符,将目录更改为C:\ Python27(安装了Python 2.7),并从该目录pip install bs4,但它没有用。我从Python 3.4复制了bs4文件夹,但它也没有用。它只给出了另一个导入错误:没有名为html.entities的模块。

如何在Python 2.7上安装bs4?提前谢谢。

1 个答案:

答案 0 :(得分:0)

我猜你可以运行pip2 install bs4pip3 install bs4在不同的python版本上单独安装它们