LoginSignup
0
0

More than 3 years have passed since last update.

herokuにデプロイする際にpackage installation failed出た時の対処

Last updated at Posted at 2020-11-19

使用機器

  • macOS

発生したエラー

  • pipenv install django-herokuを実行した際に、以下のエラーが発生した。
$ 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

エラーの原因

  • postgresqlはインストール済み。

  • 色々調べてみた結果「opensslがないよ!」と言われているということが分かったのでその辺りを調べてみると下記の方法で解決できました。

解決方法

  • 以下のコマンドで自分の場合は解決することができた。
$ xcode-select --install

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

参考サイト

Package installation failed - psycopg2 in OsX
Can't install psycopg2 package through pip install… Is this because of Sierra?

Herokuでよくあるエラーまとめリンク

  • 今回のエラーの副産物として参考になりそうなサイトがあったので、一応貼り付けておきます。

公式ドキュメント(Git周り)
Pyhton Heroku でpushできなくてあきらめる前に見るページ
DjangoをHerokuにデプロイしてもアプリケーションエラーになる時に見直すべきこと

最後に

Herokuでのデプロイに関しては、様々なエラーがあるようで中々上手くいかない場合もあるようです。
例えば諸々の設定終わってPushしようと思ったら出来ないとか…。
海外のサイトなどで調べつつなんとか自己解決できたので良かったです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0