An error occurred while installing pyicu==2.8

  git, heroku, pipenv, pyicu, python

I have built an API server with python’s Flask package. I’m trying to deploy the server on Heroku using the terminal but doesn’t seem to work. I have already tried using the Heroku Build Pack to install packages listed in the Aptfile with contents:

libicu-dev
pkg-config
python3-icu
python3-setuptools

I also added the and Python Build Pack in the Heroku Web Dashboard. During the installation of Apt Packages here’s the output I get with the Heroku Build Pack:

Using buildpacks:
remote:        1. https://github.com/heroku/heroku-buildpack-apt.git
remote:        2. heroku/python
remote: -----> Apt app detected
remote: -----> Detected Aptfile or Stack changes, flushing cache
remote: -----> Updating apt caches
remote:        Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
remote:        Get:2 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
remote:        Get:3 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease [86.6 kB]
remote:        Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
remote:        Get:5 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages [356 kB]
remote:        Get:6 http://archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,232 kB]
remote:        Get:7 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [809 kB]
remote:        Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,689 kB]
remote:        Get:9 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,098 kB]
remote:        Fetched 5,499 kB in 1s (4,812 kB/s)
remote:        Reading package lists...
remote: -----> Fetching .debs for libicu-dev
remote:        Reading package lists...
remote:        Building dependency tree...
remote:        0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 10 not upgraded.
remote:        Need to get 9,450 kB of archives.
remote:        After this operation, 0 B of additional disk space will be used.
remote:        Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 libicu-dev amd64 66.1-2ubuntu2 [9,450 kB]
remote:        Fetched 9,450 kB in 1s (10.4 MB/s)
remote:        Download complete and in download only mode
remote: -----> 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 10 not upgraded.
remote:        Need to get 45.5 kB of archives.
remote:        After this operation, 0 B of additional disk space will be used.
remote:        Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 pkg-config amd64 0.29.1-0ubuntu4 [45.5 kB]
remote:        Fetched 45.5 kB in 0s (152 kB/s)
remote:        Download complete and in download only mode
remote: -----> Fetching .debs for python3-icu
remote:        Reading package lists...
remote:        Building dependency tree...
remote:        The following NEW packages will be installed:
remote:          python3-icu
remote:        0 upgraded, 1 newly installed, 0 to remove, and 10 not upgraded.
remote:        Need to get 250 kB of archives.
remote:        After this operation, 1,192 kB of additional disk space will be used.
remote:        Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 python3-icu amd64 2.4.2-0ubuntu3 [250 kB]
remote:        Fetched 250 kB in 0s (536 kB/s)
remote:        Download complete and in download only mode
remote: -----> Fetching .debs for python3-setuptools
remote:        Reading package lists...
remote:        Building dependency tree...
remote:        The following additional packages will be installed:
remote:          python3-pkg-resources
remote:        Suggested packages:
remote:          python-setuptools-doc
remote:        The following NEW packages will be installed:
remote:          python3-pkg-resources python3-setuptools
remote:        0 upgraded, 2 newly installed, 0 to remove and 10 not upgraded.
remote:        Need to get 460 kB of archives.
remote:        After this operation, 2,047 kB of additional disk space will be used.
remote:        Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 python3-pkg-resources all 45.2.0-1 [130 kB]
remote:        Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 python3-setuptools all 45.2.0-1 [330 kB]
remote:        Fetched 460 kB in 1s (766 kB/s)
remote:        Download complete and in download only mode
remote: -----> Installing libicu-dev_66.1-2ubuntu2_amd64.deb
remote: -----> Installing pkg-config_0.29.1-0ubuntu4_amd64.deb
remote: -----> Installing python3-icu_2.4.2-0ubuntu3_amd64.deb
remote: -----> Installing python3-pkg-resources_45.2.0-1_all.deb
remote: -----> Installing python3-setuptools_45.2.0-1_all.deb
remote: -----> Writing profile script
remote: -----> Rewrite package-config files
remote: -----> Python app detected

Then after the Heroku build pack is completed, it moves to the Heroku/python build pack which yields the following error:

Python app detected
remote: -----> Using Python version specified in Pipfile.lock
remote: -----> Installing python-3.9.9
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing dependencies with Pipenv 2020.11.15
remote:        Installing dependencies from Pipfile.lock (c42b58)...
remote:        An error occurred while installing pyicu==2.8 --hash=sha256:3d80de47045a8163db5aebc947c42b4d429eeea4f0c32af4f40b33981fa872b9! Will try again.
remote:        Installing initially failed dependencies...
remote:        [InstallError]:   File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/cli/command.py", line 233, in install
remote:        [InstallError]:       retcode = do_install(
remote:        [InstallError]:   File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/core.py", line 2052, in do_install
remote:        [InstallError]:       do_init(
remote:        [InstallError]:   File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/core.py", line 1304, in do_init
remote:        [InstallError]:       do_install_dependencies(
remote:        [InstallError]:   File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/core.py", line 899, in do_install_dependencies
remote:        [InstallError]:       batch_install(
remote:        [InstallError]:   File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/core.py", line 796, in batch_install
remote:        [InstallError]:       _cleanup_procs(procs, failed_deps_queue, retry=retry)
remote:        [InstallError]:   File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/core.py", line 703, in _cleanup_procs
remote:        [InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
remote:        [pipenv.exceptions.InstallError]: Collecting pyicu==2.8
remote:        [pipenv.exceptions.InstallError]:   Using cached PyICU-2.8.tar.gz (299 kB)
remote:        [pipenv.exceptions.InstallError]: ERROR: Disabling PEP 517 processing is invalid: project specifies a build backend of setuptools.build_meta in pyproject.toml
remote:        ERROR: Couldn't install package: pyicu
remote:         Package installation failed...
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to pacific-ridge-08688.
remote: 
To https://git.heroku.com/pacific-ridge-08688.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pacific-ridge-08688.git'

Perhaps I might be missing one simple thing. I heard I can use PIP to install these on Heroku then it’ll give me a detailed error stack, but I have no idea how to disable Pipenv. I would appreciate any kind assistance.

Thank you.

Source: Python Questions

LEAVE A COMMENT