title: ModuleNotFoundError: No module named 'bs4' in heroku
body: <p>I'm trying to use <code>beautifulsoup</code> to make a line bot and push the code to Heroku.</p>
  
  <p>My code can run in local but after pushed to Heroku it had the following error:</p>
  
  <pre><code>2019-11-30T13:31:11.000000+00:00 app[api]: Build started by user bd5105625@gmail.com
  2019-11-30T13:31:39.747108+00:00 heroku[web.1]: State changed from crashed to starting
  2019-11-30T13:31:39.433541+00:00 app[api]: Deploy b5926928 by user bd5105625@gmail.com
  2019-11-30T13:31:39.433541+00:00 app[api]: Release v70 created by user bd5105625@gmail.com
  2019-11-30T13:31:45.640906+00:00 heroku[web.1]: Starting process with command `python app.py`
  2019-11-30T13:31:48.788434+00:00 heroku[web.1]: State changed from starting to crashed
  2019-11-30T13:31:48.693417+00:00 app[web.1]: Traceback (most recent call last):
  2019-11-30T13:31:48.693438+00:00 app[web.1]:   File "app.py", line 11, in &lt;module&gt;
  2019-11-30T13:31:48.693606+00:00 app[web.1]:     from fsm import TocMachine
  2019-11-30T13:31:48.693609+00:00 app[web.1]:   File "/app/fsm.py", line 4, in &lt;module&gt;
  2019-11-30T13:31:48.693743+00:00 app[web.1]:     from ptt import ptt
  2019-11-30T13:31:48.693746+00:00 app[web.1]:   File "/app/ptt.py", line 2, in &lt;module&gt;
  2019-11-30T13:31:48.693878+00:00 app[web.1]:     from bs4 import BeautifulSoup
  2019-11-30T13:31:48.693884+00:00 app[web.1]: ModuleNotFoundError: No module named 'bs4'
  2019-11-30T13:31:48.774322+00:00 heroku[web.1]: Process exited with status 1
  2019-11-30T13:31:51.000000+00:00 app[api]: Build succeeded
  </code></pre>
  
  <p>In <code>requirements.txt</code>, I have included <code>bs4==0.0.1</code> and <code>beautifulsoup4==4.7.1</code> but logs in Heroku still have this error</p>
  
  <p>The following is <code>requirements.txt</code> code</p>
  
  <pre><code>-i https://pypi.org/simple
  certifi==2019.9.11
  chardet==3.0.4
  click==7.0
  flask==1.0.2
  future==0.18.1
  idna==2.8
  itsdangerous==1.1.0
  jinja2==2.10.3
  line-bot-sdk==1.14.0
  markupsafe==1.1.1
  pygraphviz==1.5
  python-dotenv==0.10.3
  requests==2.22.0
  six==1.12.0
  transitions==0.6.9
  urllib3==1.25.6
  werkzeug==0.16.0
  bs4==0.0.1
  beautifulsoup4==4.7.1
  </code></pre>
  
  <p>The following is output from <code>git push</code></p>
  
  <pre><code>Enumerating objects: 5, done.
  Counting objects: 100% (5/5), done.
  Delta compression using up to 4 threads
  Compressing objects: 100% (3/3), done.
  Writing objects: 100% (3/3), 275 bytes | 275.00 KiB/s, done.
  Total 3 (delta 2), reused 0 (delta 0)
  remote: Compressing source files... done.
  remote: Building source:
  remote:
  remote: -----&gt; Apt app detected
  remote: -----&gt; Reusing cache
  remote: -----&gt; Updating apt caches
  remote:        Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
  remote:        Hit:2 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease
  remote:        Get:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
  remote:        Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  remote:        Fetched 88.7 kB in 1s (133 kB/s)
  remote:        Reading package lists...
  remote: -----&gt; Fetching .debs for graphviz
  remote:        Reading package lists...
  remote:        Building dependency tree...
  remote:        The following additional packages will be installed:
  remote:          fonts-liberation libann0 libcdt5 libcgraph6 libgts-0.7-5 libgts-bin libgvc6
  remote:          libgvpr2 liblab-gamut1 libpathplan4 libxaw7 libxmu6
  remote:        Suggested packages:
  remote:          graphviz-doc
  remote:        The following NEW packages will be installed:
  remote:          fonts-liberation graphviz libann0 libcdt5 libcgraph6 libgts-0.7-5 libgts-bin
  remote:          libgvc6 libgvpr2 liblab-gamut1 libpathplan4 libxaw7 libxmu6
  remote:        0 upgraded, 13 newly installed, 0 to remove and 57 not upgraded.
  remote:        Need to get 0 B/2,889 kB of archives.
  remote:        After this operation, 11.6 MB of additional disk space will be used.
  remote:        Download complete and in download only mode
  remote: -----&gt; Fetching .debs for libgraphviz-dev
  remote:        Reading package lists...
  remote:        Building dependency tree...
  remote:        The following additional packages will be installed:
  remote:          adwaita-icon-theme gtk-update-icon-cache humanity-icon-theme libatk1.0-0
  remote:          libatk1.0-data libcdt5 libcgraph6 libgail-common libgail18 libgtk2.0-0
  remote:          libgtk2.0-bin libgtk2.0-common libgts-0.7-5 libgts-bin libgvc6
  remote:          libgvc6-plugins-gtk libgvpr2 liblab-gamut1 libpathplan4 libxcomposite1
  remote:          libxcursor1 libxdamage1 libxdot4 libxfixes3 libxi6 libxinerama1 libxrandr2
  remote:          ubuntu-mono
  remote:        Suggested packages:
  remote:          gvfs
  remote:        The following NEW packages will be installed:
  remote:          adwaita-icon-theme gtk-update-icon-cache humanity-icon-theme libatk1.0-0
  remote:          libatk1.0-data libcdt5 libcgraph6 libgail-common libgail18 libgraphviz-dev
  remote:          libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgts-0.7-5 libgts-bin libgvc6
  remote:          libgvc6-plugins-gtk libgvpr2 liblab-gamut1 libpathplan4 libxcomposite1
  remote:          libxcursor1 libxdamage1 libxdot4 libxfixes3 libxi6 libxinerama1 libxrandr2
  remote:          ubuntu-mono
  remote:        0 upgraded, 29 newly installed, 0 to remove and 57 not upgraded.
  remote:        Need to get 0 B/8,221 kB of archives.
  remote:        After this operation, 46.2 MB of additional disk space will be used.
  remote:        Download complete and in download only mode
  remote: -----&gt; Fetching .debs for pkg-config
  remote:        Reading package lists...
  remote:        Building dependency tree...
  remote:        0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 57 not upgraded.
  remote:        Need to get 0 B/45.0 kB of archives.
  remote:        After this operation, 0 B of additional disk space will be used.
  remote:        Download complete and in download only mode
  remote: -----&gt; Installing adwaita-icon-theme_3.28.0-1ubuntu1_all.deb
  remote: -----&gt; Installing fonts-liberation_1%3a1.07.4-7~18.04.1_all.deb
  remote: -----&gt; Installing graphviz_2.40.1-2_amd64.deb
  remote: -----&gt; Installing gtk-update-icon-cache_3.22.30-1ubuntu4_amd64.deb
  remote: -----&gt; Installing humanity-icon-theme_0.6.15_all.deb
  remote: -----&gt; Installing libann0_1.1.2+doc-6_amd64.deb
  remote: -----&gt; Installing libatk1.0-0_2.28.1-1_amd64.deb
  remote: -----&gt; Installing libatk1.0-data_2.28.1-1_all.deb
  remote: -----&gt; Installing libcdt5_2.40.1-2_amd64.deb
  remote: -----&gt; Installing libcgraph6_2.40.1-2_amd64.deb
  remote: -----&gt; Installing libgail18_2.24.32-1ubuntu1_amd64.deb
  remote: -----&gt; Installing libgail-common_2.24.32-1ubuntu1_amd64.deb
  remote: -----&gt; Installing libgraphviz-dev_2.40.1-2_amd64.deb
  remote: -----&gt; Installing libgtk2.0-0_2.24.32-1ubuntu1_amd64.deb
  remote: -----&gt; Installing libgtk2.0-bin_2.24.32-1ubuntu1_amd64.deb
  remote: -----&gt; Installing libgtk2.0-common_2.24.32-1ubuntu1_all.deb
  remote: -----&gt; Installing libgts-0.7-5_0.7.6+darcs121130-4_amd64.deb
  remote: -----&gt; Installing libgts-bin_0.7.6+darcs121130-4_amd64.deb
  remote: -----&gt; Installing libgvc6_2.40.1-2_amd64.deb
  remote: -----&gt; Installing libgvc6-plugins-gtk_2.40.1-2_amd64.deb
  remote: -----&gt; Installing libgvpr2_2.40.1-2_amd64.deb
  remote: -----&gt; Installing liblab-gamut1_2.40.1-2_amd64.deb
  remote: -----&gt; Installing libpathplan4_2.40.1-2_amd64.deb
  remote: -----&gt; Installing libxaw7_2%3a1.0.13-1_amd64.deb
  remote: -----&gt; Installing libxcomposite1_1%3a0.4.4-2_amd64.deb
  remote: -----&gt; Installing libxcursor1_1%3a1.1.15-1_amd64.deb
  remote: -----&gt; Installing libxdamage1_1%3a1.1.4-3_amd64.deb
  remote: -----&gt; Installing libxdot4_2.40.1-2_amd64.deb
  remote: -----&gt; Installing libxfixes3_1%3a5.0.3-1_amd64.deb
  remote: -----&gt; Installing libxi6_2%3a1.7.9-1_amd64.deb
  remote: -----&gt; Installing libxinerama1_2%3a1.1.3-1_amd64.deb
  remote: -----&gt; Installing libxmu6_2%3a1.1.2-2_amd64.deb
  remote: -----&gt; Installing libxrandr2_2%3a1.5.1-1_amd64.deb
  remote: -----&gt; Installing pkg-config_0.29.1-0ubuntu2_amd64.deb
  remote: -----&gt; Installing ubuntu-mono_16.10+18.04.20181005-0ubuntu1_all.deb
  remote: -----&gt; Writing profile script
  remote: -----&gt; Rewrite package-config files
  remote: -----&gt; Python app detected
  remote:        Skipping installation, as Pipfile.lock hasn't changed since last deploy.
  remote: -----&gt; Discovering process types
  remote:        Procfile declares types -&gt; web
  remote:
  remote: -----&gt; Compressing...
  remote:        Done: 74.2M
  remote: -----&gt; Launching...
  remote:        Released v73
  remote:        https://computertheory-project.herokuapp.com/ deployed to Heroku
  remote:
  remote: Verifying deploy... done.
  </code></pre>
  
  <p>How can I deal with this problem?</p>