[PYTHON] What to do if package installation fails when deploying to heroku

Used equipment

Error that occurred

--When I ran pipenv install django-heroku, I got the following error:

$ pipenv install django-heroku


ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

ERROR: package installation failed

Cause of error

--postgresql is already installed.

――As a result of various investigations, I found that it was said that "There is no openssl!", So when I investigated the area, I was able to solve it by the following method.

Solutions

--I was able to solve it in my case with the following command.

$ xcode-select --install

$ env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pipenv install psycopg2

Reference site

[Package installation failed - psycopg2 in OsX] (https://stackoverflow.com/questions/55922840/package-installation-failed-psycopg2-in-osx) [Can't install psycopg2 package through pip install… Is this because of Sierra?] (https://stackoverflow.com/questions/39767810/cant-install-psycopg2-package-through-pip-install-is-this-because-of-sierra)

Common error summary links on Heroku

――There was a site that could be helpful as a by-product of this error, so I will paste it for the time being.

[Official documentation (around Git)] (https://devcenter.heroku.com/articles/git#deploying-code) Page to see before giving up because I can't push on Pyhton Heroku What to review if deploying Django to Heroku causes an application error

Finally

Regarding deploying on Heroku, it seems that there are various errors and it may not work. For example, if you finish various settings and try to push, you can't do it ... I'm glad that I managed to solve it myself while checking it on overseas sites.

Recommended Posts

What to do if package installation fails when deploying to heroku
What to do if SciPy installation fails on CentOS
Note: What to do if pip install fails
What to do if pip install fails in Xcode 5.1
What to do if pip install fails to install dependent libraries
What to do when Ubuntu crashes
What to do if `pip install matplotlib` fails on Mac
What to do if pip install mysqlclient fails on MacOS
What to do if GeoPandas installation fails (Fiona / GDAL error * Rtree installation method is also added)
What to do if Insecure Platform Warning appears when running Python
Solution for errors when deploying to Heroku
What to do if the yum command fails to set locale, defaulting to C
What to do if you get stuck during Anaconda installation on Linux
What to do if an error occurs when importing numpy with VScode
What to do if you get an error when trying to load mnist
What to do if fprintd requires a password when registering your fingerprint
What to do if you get an error when installing Dlib (Ubuntu)
What to do if pipreqs results in UnicodeDecodeError
What to do if you can't pipenv shell
What to do if pip cannot be installed
What to do when PermissionError of tempfile.mkstemp occurs
What to do if atom autocomplete-python doesn't work
What to do if Docker-sync suddenly stops working
What to do if "amazon-linux-extras" → "No module named amazon_linux_extras"
What to do if CERTIFICATE_VERIFY_FAILED occurs when nltk.download () is done on macOS pyhon
What to do if you get an error when installing python with pyenv
What to do if abort is displayed when inputting camera video in OpenCV
[Go 1.13] What to do when unexpected directory layout: appears
[openpyxl] What to do when IllegalCharacterError appears in pandas.DataFrame.to_excel
What to do if you can't pip install mysqlclient
curl: (60) What to do when Issuer certificate is invalid.
No module named What to do if you get'libs.resources'
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
What to do when gdal_merge creates a huge file
What to do when raise ValueError, "unsupported hash type"
What to do if a UnicodeDecodeError occurs in pip
Articles to see when installation for Python + OpenCV fails
What to do when "cannot import name xxx" [Python]
What to do if sys / cdefs.h does not exist
What to do if pyenv is not enabled (zsh)
What to do when you can't bind CaboCha to Python
What to do if "export" keeps appearing on terminal when trying to put Python on macOS
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if you get a memory error when converting from PySparkDataFrame to PandasDataFrame
What to do if you get an Import Error when importing matplotlib with Jupyter
What to do if you don't want to use Japanese column names when using ortoolpy.logistics_network
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
What to do if a communication error occurs due to proxy when installing with package management of pip, npm, gem
[AWS] What to do when you want to pip with Lambda
What to do when Japanese is not displayed on matplotlib
What to do if you are addicted to Windows character code
What to do if pip gives a DistributionError in Homebrew
What to do when PyCharm font is strange or garbled
What to do when a Remove Error occurs when updating conda
What to do when Unalignable boolean Series provided as indexer
What to do if you get "coverage unknown" in Coveralls
What to do if a 0xC0000005 error occurs in tf.train.start_queue_runners ()
What to do when an error occurs with import _ssl
What to do when "SSL: CERTIFICATE_VERIFY_FAILED _ssl.c: 1056" appears in Python
OSError: [Errno 40] What to do when Message too long appears
What to do when "Invalid HTTP_HOST header" appears in Django