今天对我来说是糟糕的一天。我很沮丧,因为我花了4个小时试图安装beautifulsoup4
。我搜遍了所有能拿到的教程。
它安装在我的计算机上,但是当我在shell上执行import bs4
操作时,它会给我以下消息:
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
import bs4
File "C:\Python34\lib\bs4\__init__.py", line 48
'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>'You need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).'
有人知道我能做什么吗?它告诉我运行一个命令,但它不告诉我如何运行它。
我有同样的问题,这似乎是通过TAR文件安装最新版本的beautifulsoup的问题。
我回去得到了4.1.3版本,现在它在Python3.4中对我有效
希望这有帮助。
让我们让这对您来说很简单(如果您使用的是3x版本的Python)
你完了。
答案就在这个问题上。在bs4所在的文件夹中(也可以在工作文件夹中下载bs4),运行:
相关问题 更多 >
编程相关推荐