0

I'm trying to deploy a flask app to heroku and I'm very confused, I'll admit, I'm kind of a noob and I'm having a lot of trouble first of all understand what wheels are and all that stuff but more importantly, I added a requirements.txt folder for my app :


pyicu
pycld2
morfessor
icu4c
libicu-dev
polyglot
google
boilerpy3
beautifulsoup4
google
python-Levenshtein
rake-nltk
pandas
fake-useragent
gensim
numpy

But whenever I try to run the command : git push heroku master:main I get the following error :

Oliviers-MacBook-Air:flaskapp Ile-Maurice$ git push heroku master:main
Enumerating objects: 56, done.
Counting objects: 100% (56/56), done.
Delta compression using up to 4 threads
Compressing objects: 100% (53/53), done.
Writing objects: 100% (56/56), 32.10 KiB | 2.67 MiB/s, done.
Total 56 (delta 15), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote:  !     Python has released a security update! Please consider upgrading to python-3.8.12
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtime
remote: -----> Installing python-3.8.10
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting pyicu
remote:          Downloading PyICU-2.8.1.tar.gz (304 kB)
remote:          Installing build dependencies: started
remote:          Installing build dependencies: finished with status 'done'
remote:          Getting requirements to build wheel: started
remote:          Getting requirements to build wheel: finished with status 'done'
remote:          Preparing metadata (pyproject.toml): started
remote:          Preparing metadata (pyproject.toml): finished with status 'done'
remote:        Collecting pycld2
remote:          Downloading pycld2-0.41.tar.gz (41.4 MB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting morfessor
remote:          Downloading Morfessor-2.0.6-py3-none-any.whl (35 kB)
remote:        ERROR: Could not find a version that satisfies the requirement icu4c (from versions: none)
remote:        ERROR: No matching distribution found for icu4c
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to purgescan.
remote: 
To https://git.heroku.com/purgescan.git
 ! [remote rejected] master -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/purgescan.git'

But when I remove the dependency icu4c it says it can't download PyIcu. It gives me this error :

Oliviers-MacBook-Air:flaskapp Ile-Maurice$ git push heroku master:main
Enumerating objects: 57, done.
Counting objects: 100% (57/57), done.
Delta compression using up to 4 threads
Compressing objects: 100% (54/54), done.
Writing objects: 100% (57/57), 32.19 KiB | 2.93 MiB/s, done.
Total 57 (delta 16), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote:  !     Python has released a security update! Please consider upgrading to python-3.8.12
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtime
remote: -----> Installing python-3.8.10
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting pyicu
remote:          Downloading PyICU-2.8.1.tar.gz (304 kB)
remote:          Installing build dependencies: started
remote:          Installing build dependencies: finished with status 'done'
remote:          Getting requirements to build wheel: started
remote:          Getting requirements to build wheel: finished with status 'done'
remote:          Preparing metadata (pyproject.toml): started
remote:          Preparing metadata (pyproject.toml): finished with status 'done'
remote:        Collecting pycld2
remote:          Downloading pycld2-0.41.tar.gz (41.4 MB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting morfessor
remote:          Downloading Morfessor-2.0.6-py3-none-any.whl (35 kB)
remote:        ERROR: Could not find a version that satisfies the requirement libicu-dev (from versions: none)
remote:        ERROR: No matching distribution found for libicu-dev
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to purgescan.
remote: 

Then when I remove libicu-dev it gives me this error :

Oliviers-MacBook-Air:flaskapp Ile-Maurice$ git push heroku master:main
Enumerating objects: 58, done.
Counting objects: 100% (58/58), done.
Delta compression using up to 4 threads
Compressing objects: 100% (55/55), done.
Writing objects: 100% (58/58), 32.28 KiB | 2.93 MiB/s, done.
Total 58 (delta 17), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote:  !     Python has released a security update! Please consider upgrading to python-3.8.12
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtime
remote: -----> Installing python-3.8.10
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting pyicu
remote:          Downloading PyICU-2.8.1.tar.gz (304 kB)
remote:          Installing build dependencies: started
remote:          Installing build dependencies: finished with status 'done'
remote:          Getting requirements to build wheel: started
remote:          Getting requirements to build wheel: finished with status 'done'
remote:          Preparing metadata (pyproject.toml): started
remote:          Preparing metadata (pyproject.toml): finished with status 'done'
remote:        Collecting pycld2
remote:          Downloading pycld2-0.41.tar.gz (41.4 MB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting morfessor
remote:          Downloading Morfessor-2.0.6-py3-none-any.whl (35 kB)
remote:        Collecting polyglot
remote:          Downloading polyglot-16.7.4.tar.gz (126 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting google
remote:          Downloading google-3.0.0-py2.py3-none-any.whl (45 kB)
remote:        Collecting boilerpy3
remote:          Downloading boilerpy3-1.0.6-py3-none-any.whl (22 kB)
remote:        Collecting beautifulsoup4
remote:          Downloading beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
remote:        Collecting python-Levenshtein
remote:          Downloading python-Levenshtein-0.12.2.tar.gz (50 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting rake-nltk
remote:          Downloading rake_nltk-1.0.6-py3-none-any.whl (9.1 kB)
remote:        Collecting pandas
remote:          Downloading pandas-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB)
remote:        Collecting fake-useragent
remote:          Downloading fake-useragent-0.1.11.tar.gz (13 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting gensim
remote:          Downloading gensim-4.1.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (24.1 MB)
remote:        Collecting numpy
remote:          Downloading numpy-1.22.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
remote:        Collecting soupsieve>1.2
remote:          Downloading soupsieve-2.3.1-py3-none-any.whl (37 kB)
remote:        Collecting nltk<4.0.0,>=3.6.2
remote:          Downloading nltk-3.7-py3-none-any.whl (1.5 MB)
remote:        Collecting pytz>=2020.1
remote:          Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
remote:        Collecting python-dateutil>=2.8.1
remote:          Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB
remote:        Collecting smart-open>=1.8.1
remote:          Downloading smart_open-5.2.1-py3-none-any.whl (58 kB)
remote:        Collecting scipy>=0.18.1
remote:          Downloading scipy-1.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (41.6 MB)
remote:        Collecting joblib
remote:          Downloading joblib-1.1.0-py2.py3-none-any.whl (306 kB)
remote:        Collecting regex>=2021.8.3
remote:          Downloading regex-2022.1.18-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (764 kB)
remote:        Collecting tqdm
remote:          Downloading tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
remote:        Collecting click
remote:          Downloading click-8.0.4-py3-none-any.whl (97 kB)
remote:        Collecting six>=1.5
remote:          Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
remote:        Building wheels for collected packages: pyicu, pycld2, polyglot, python-Levenshtein, fake-useragent
remote:          Building wheel for pyicu (pyproject.toml): started
remote:          Building wheel for pyicu (pyproject.toml): finished with status 'error'
remote:          ERROR: Command errored out with exit status 1:
remote:           command: /app/.heroku/python/bin/python /app/.heroku/python/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpdyg49592
remote:               cwd: /tmp/pip-install-2_wekphe/pyicu_655ea7a694164754a92f270a8665cab7
remote:          Complete output (89 lines):
remote:          (running 'icu-config --version')
remote:          (running 'pkg-config --modversion icu-i18n')
remote:          
remote:          Building PyICU 2.8.1 for ICU 66.1 (max ICU major version supported: 70)
remote:          
remote:          (running 'icu-config --cxxflags --cppflags')
remote:          Could not configure CFLAGS with icu-config
remote:          (running 'pkg-config --cflags icu-i18n')
remote:          (running 'icu-config --ldflags')
remote:          Could not configure LFLAGS with icu-config
remote:          (running 'pkg-config --libs icu-i18n')
remote:          Adding LFLAGS="-licui18n -licuuc -licudata" from /usr/bin/pkg-config
remote:          running bdist_wheel
remote:          running build
remote:          running build_py
remote:          creating build
remote:          creating build/lib.linux-x86_64-3.8
remote:          creating build/lib.linux-x86_64-3.8/icu
remote:          copying py/icu/__init__.py -> build/lib.linux-x86_64-3.8/icu
remote:          running build_ext
remote:          building 'icu._icu_' extension
remote:          creating build/temp.linux-x86_64-3.8
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/app/.heroku/python/include/python3.8 -c _icu_.cpp -o build/temp.linux-x86_64-3.8/_icu_.o -DPYICU_VER=\"2.8.1\" -DPYICU_ICU_MAX_VER=\"70\
remote:          In file included from /usr/include/c++/9/clocale:42,
remote:                           from /usr/include/x86_64-linux-gnu/c++/9/bits/c++locale.h:41,
remote:                           from /usr/include/c++/9/bits/localefwd.h:40,
remote:                           from /usr/include/c++/9/string:43,
remote:                           from /usr/include/unicode/std_string.h:37,
remote:                           from /usr/include/unicode/unistr.h:38,
remote:                           from common.h:107,
remote:                           from _icu_.cpp:27:
remote:          ./locale.h:29:23: error: ‘Locale’ was not declared in this scope; did you mean ‘locale_t’?
remote:             29 | PyObject *wrap_Locale(Locale *locale, int flags);
remote:                |                       ^~~~~~
remote:                |                       locale_t
remote:          ./locale.h:29:31: error: ‘locale’ was not declared in this scope; did you mean ‘locale_t’?
remote:             29 | PyObject *wrap_Locale(Locale *locale, int flags);
remote:                |                               ^~~~~~
remote:                |                               locale_t
remote:          ./locale.h:29:39: error: expected primary-expression before ‘int’
remote:             29 | PyObject *wrap_Locale(Locale *locale, int flags);
remote:                |                                       ^~~
remote:          ./locale.h:29:48: error: expression list treated as compound expression in initializer [-fpermissive]
remote:             29 | PyObject *wrap_Locale(Locale *locale, int flags);
remote:                |                                                ^
remote:          ./locale.h:30:29: error: ‘Locale’ does not name a type; did you mean ‘locale_t’?
remote:             30 | PyObject *wrap_Locale(const Locale &locale);
remote:                |                             ^~~~~~
remote:                |                             locale_t
remote:          ./locale.h:30:43: error: ‘PyObject* wrap_Locale(const int&)’ redeclared as different kind of entity
remote:             30 | PyObject *wrap_Locale(const Locale &locale);
remote:                |                                           ^
remote:          ./locale.h:29:11: note: previous declaration ‘PyObject* wrap_Locale’
remote:             29 | PyObject *wrap_Locale(Locale *locale, int flags);
remote:                |           ^~~~~~~~~~~
remote:          In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/c++locale.h:41,
remote:                           from /usr/include/c++/9/bits/localefwd.h:40,
remote:                           from /usr/include/c++/9/string:43,
remote:                           from /usr/include/unicode/std_string.h:37,
remote:                           from /usr/include/unicode/unistr.h:38,
remote:                           from common.h:107,
remote:                           from _icu_.cpp:27:
remote:          /usr/include/c++/9/clocale:53:11: error: ‘::lconv’ has not been declared
remote:             53 |   using ::lconv;
remote:                |           ^~~~~
remote:          /usr/include/c++/9/clocale:54:11: error: ‘::setlocale’ has not been declared
remote:             54 |   using ::setlocale;
remote:                |           ^~~~~~~~~
remote:          /usr/include/c++/9/clocale:55:11: error: ‘::localeconv’ has not been declared
remote:             55 |   using ::localeconv;
remote:                |           ^~~~~~~~~~
remote:          In file included from /usr/include/c++/9/bits/localefwd.h:40,
remote:                           from /usr/include/c++/9/string:43,
remote:                           from /usr/include/unicode/std_string.h:37,
remote:                           from /usr/include/unicode/unistr.h:38,
remote:                           from common.h:107,
remote:                           from _icu_.cpp:27:
remote:          /usr/include/x86_64-linux-gnu/c++/9/bits/c++locale.h:52:23: error: ‘uselocale’ was not declared in this scope; did you mean ‘u_fsetlocale’?
remote:             52 |   extern "C" __typeof(uselocale) __uselocale;
remote:                |                       ^~~~~~~~~
remote:                |                       u_fsetlocale
remote:          /usr/include/x86_64-linux-gnu/c++/9/bits/c++locale.h: In function ‘int std::__convert_from_v(__locale_struct* const&, char*, int, const char*, ...)’:
remote:          /usr/include/x86_64-linux-gnu/c++/9/bits/c++locale.h:75:53: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
remote:             75 |     __c_locale __old = __gnu_cxx::__uselocale(__cloc);
remote:                |                                                     ^
remote:          /usr/include/x86_64-linux-gnu/c++/9/bits/c++locale.h:100:33: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
remote:            100 |     __gnu_cxx::__uselocale(__old);
remote:                |                                 ^
remote:          error: command '/usr/bin/gcc' failed with exit code 1
remote:          ----------------------------------------
remote:          ERROR: Failed building wheel for pyicu
remote:          Building wheel for pycld2 (setup.py): started
remote:          Building wheel for pycld2 (setup.py): finished with status 'done'
remote:          Created wheel for pycld2: filename=pycld2-0.41-cp38-cp38-linux_x86_64.whl size=9917240 sha256=205374f55daccd5b05e97cda1f0626fe06daa52892c64c3f27294264d9add81c
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-sodv8bdz/wheels/2b/3a/82/d990040cbe6c3527732e931e2925785e83fe9aaa5a11c313ca
remote:          Building wheel for polyglot (setup.py): started
remote:          Building wheel for polyglot (setup.py): finished with status 'done'
remote:          Created wheel for polyglot: filename=polyglot-16.7.4-py2.py3-none-any.whl size=52578 sha256=fde7908d5a89173e7598415b69b8ee7241f998c6dcf90c40512c06cf49a1c21f
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-sodv8bdz/wheels/9f/5e/19/5d7096ca9d067df54509d4bd382332e1babeef05715a13ac39
remote:          Building wheel for python-Levenshtein (setup.py): started
remote:          Building wheel for python-Levenshtein (setup.py): finished with status 'done'
remote:          Created wheel for python-Levenshtein: filename=python_Levenshtein-0.12.2-cp38-cp38-linux_x86_64.whl size=185003 sha256=7991566831261fba0af4d94f7f5de5af3815685a75b6399f86be03827a6c7308
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-sodv8bdz/wheels/d7/0c/76/042b46eb0df65c3ccd0338f791210c55ab79d209bcc269e2c7
remote:          Building wheel for fake-useragent (setup.py): started
remote:          Building wheel for fake-useragent (setup.py): finished with status 'done'
remote:          Created wheel for fake-useragent: filename=fake_useragent-0.1.11-py3-none-any.whl size=13502 sha256=d5ddad99263d8f8647050d992f4e90e67b76fd307298c851293075fd93c89d65
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-sodv8bdz/wheels/a0/b8/b7/8c942b2c5be5158b874a88195116b05ad124bac795f6665e65
remote:        Successfully built pycld2 polyglot python-Levenshtein fake-useragent
remote:        Failed to build pyicu
remote:        ERROR: Could not build wheels for pyicu, which is required to install pyproject.toml-based projects
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to purgescan.
remote: 

I just keep running into issues I don't really understand why. Can anyone help me please? Thanks!

  • 2
    What is `icu4c`? [It's not on PyPI](https://pypi.org/search/?q=icu4c). "But when I remove the dependency icu4c it says it can't download PyIcu"—please show us the full error you get when `icu4c` is not listed as a dependency. – ChrisGPT was on strike Feb 23 '22 at 16:49
  • Ok, added the error, I'm not actually sure what icu4c is, it was in some code I wrote a really long time ago I think. – SalvorHardin Feb 23 '22 at 16:53
  • 1
    `icu4c` is the C-language ICU library, which I suspect `pyicu` depends on. I would expect to have to use yum/apt-get/conda to install icu4c, rather than pip, since it would likely get installed as a system library. – joanis Feb 23 '22 at 17:46

0 Answers0