将Flask应用程序部署到Heroku:ModuleNotFoundError:没有名为' lxml'

时间:2017-07-31 02:36:19

标签: python-3.x heroku flask deployment

烧瓶在我的本地机器上运行良好。但是,当我尝试将其部署到heroku时,我陷入了部署步骤: git push heroku master

错误是: ModuleNotFoundError: No module named 'lxml'

谢谢!

看来heroku已经成功下载了lxml模块,我怀疑路径有问题。

Downloading lxml-3.8.0-cp36-cp36m-manylinux1_x86_64.whl (7.3MB)
remote:        Collecting tushare==0.8.2 (from -r /tmp/build_c53be87973e8917c338f0bc2fe032c48/requirements.txt (line 46))
remote:          

Downloading tushare-0.8.2.zip (121kB)
remote:            Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-build-a4xb2e0z/tushare/setup.py", line 4, in <module>
remote:                import tushare
remote:              File "/tmp/pip-build-a4xb2e0z/tushare/tushare/__init__.py", line 6, in <module>
remote:                from tushare.stock.trading import (get_hist_data, get_tick_data,
remote:              File "/tmp/pip-build-a4xb2e0z/tushare/tushare/stock/trading.py", line 13, in <module>
remote:                import lxml.html
remote:            ModuleNotFoundError: No module named 'lxml'

1 个答案:

答案 0 :(得分:0)

现在解决了。

  1. 从requirement.txt中删除tushare,然后执行git commit -am&#34;使其更好&#34;和git push heroku master,它会被成功推送;

  2. 将tushare放回到requirement.txt中,重做git commit -am&#34;让它变得更好&#34;和git push heroku master。