简体   繁体   English

在pyCharm中安装beautifulsoup,并安装了两个版本的python

[英]beautifulsoup installation in pyCharm with two versions of python installed

I use PyCharm to write Python, at first I configurated PyCharm with Python 2.7.12, and I installed the Beautiful Soup package under the 2.7.12 environment. 我使用PyCharm编写Python,首先使用Python 2.7.12配置了PyCharm,然后在2.7.12环境下安装了Beautiful Soup软件包。

However, I now have installed python 3.5.2 in PyCharm and I want to use Beautiful Soup in PyCharm with 3.5.2, but I can't import bs4 because the interpreter cant find the Beautiful Soup package which is in 2.7.12 package folder. 但是,我现在在PyCharm中安装了python 3.5.2,并且我想在PyCharm中将Beautiful Soup与3.5.2一起使用,但是我无法导入bs4,因为解释器无法找到2.7.12包文件夹中的Beautiful Soup包。 。

So I tried to pip install bs4 in 3.5.2 console, but it tells me that the pkg has already been installed in 2.7.12 folder. 所以我试图在3.5.2控制台pip install bs4 ,但它告诉我pkg已经安装在2.7.12文件夹中。 So how can I import Beautiful Soup in 3.5.2 now in PyCharm? 那么,现在如何在PyCharm中导入3.5.2中的Beautiful Soup?

在此处输入图片说明

To be sure to install your package for the right version of python, you can use pip as a module : 为了确保为正确版本的python安装软件包,可以将pip用作模块:

python3.5 -m pip install [package]

So for bs4 : 因此对于bs4:

python3.5 -m pip install beautifulsoup4

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

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