我想知道如何在 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呢?
1 回答

慕標琳琳
TA貢獻1830條經驗 獲得超9個贊
因為我看不到你的requirements.txt
文件,從看到錯誤我假設它有類似的東西BeautifulSoup==4
,但安裝 BeautifulSoup 的方式是pip install bs4
因為它不像 BS 的版本 4,它是 bs4 本身,所以你requirements.txt
必須包含bs4==0.0.0
orbs4==0.0.1
或只是簡單地bs4
使用任何其他依賴項。
添加回答
舉報
0/150
提交
取消