简体   繁体   English

如何在Heroku上使用Mechanize,BeautifulSoup,html2text

[英]How to use Mechanize, BeautifulSoup, html2text on Heroku

I'm deploying my app to Heroku which uses mechanize, beautifulsoup4 and html2text but there are some errors regarding to the missing dependencies on heroku. 我正在将我的应用程序部署到使用机械化,beautifulsoup4和html2text的Heroku中,但是由于缺少对Heroku的依赖关系而出现了一些错误。

I can only manage to install BeautifulSoup by adding this line to the requirements.txt: 我只能通过将以下行添加到requirements.txt来设法安装BeautifulSoup:

beautifulsoup4==4.1.3

However, I couldn't find away to install mechanize and html2text by adding to requirements.txt. 但是,我找不到通过添加到requirements.txt来安装机械化和html2text的方法。 I tried couple thing like: mechanize=xxx html2text=xxx (xxx = different versions) but none of them work so far. 我尝试了一些类似的事情:mechanize = xxx html2text = xxx(xxx =不同版本),但到目前为止它们都没有起作用。

How do I add those 2 dependencies to my requirements.txt in order to make it work on Heroku? 如何将这2个依赖项添加到我的requirements.txt中,以使其在Heroku上工作?

Thank you so much 非常感谢

I figured it out, just run pip freeze > requirements.txt and it will replace the old file by the new one with all dependencies. 我想通了,只需运行pip Frozen> requirements.txt,它将使用所有依赖项将旧文件替换为新文件。 No need to manually add it. 无需手动添加。

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

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