Python 如何在Heroku中使用BeautifulSoup4

Python 如何在Heroku中使用BeautifulSoup4,python,Python,我想知道如何在Heroku服务器上使用BeautifulSoup4 在我的requirements.txt文件中,我写了:“BeautifulSoup==4.9.1” 但我有一个错误: ERROR: Could not find a version that satisfies the requirement BeautifulSoup==4 (from -r /tmp/build_d624b770_/requirements.txt (line 1)) (from versions: 3.2.

我想知道如何在Heroku服务器上使用BeautifulSoup4

在我的requirements.txt文件中,我写了:“BeautifulSoup==4.9.1”

但我有一个错误:

ERROR: Could not find a version that satisfies the requirement BeautifulSoup==4 (from -r /tmp/build_d624b770_/requirements.txt (line 1)) (from versions: 3.2.0, 3.2.1, 3.2.2)
ERROR: No matching distribution found for BeautifulSoup==4 (from -r /tmp/build_d624b770_/requirements.txt (line 1))
那么我该如何使用BeautifulSoup4呢


感谢您的建议:)

因为我看不到您的
requirements.txt
文件,从看到错误我假设它有类似于
BeautifulSoup==4
,但是安装BeautifulSoup的方法是
pip安装bs4
,因为它与BS的第4版不同,它本身就是bs4,因此,您的
requirements.txt
必须包含
bs4==0.0.0
bs4==0.0.1
或仅包含任何其他依赖项


了解有关BS4版本的更多信息

这是否回答了您的问题?不是真的:(但还是要感谢你:D@Joona YoonNice,现在它正在安装bs4版本0.0.1:D,因为这是可行的,我有另一个问题:P我也想安装smtplib…但我得到了相同的错误。在我的requirements.txt中我有“smtplib==3.9”这也是同样的问题,
pip install secure smtplib
是实际安装,因此它必须是
secure smtplib==0.1.1
,因为您需要最新版本