5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Homebrewの更新でPipenv環境が壊れたときの対処

Posted at

例えば以下のようなエラーが出たとき

$ pipenv run ./manage.py shell
Loading .env environment variables…
dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /Users/zenwerk/.virtualenvs/some-project/bin/python
  Reason: image not found
/bin/sh: line 1: 10581 Abort trap: 6           pipenv run ./manage.py shell
make: *** [shell] Error 134

Pipfileがあるディレクトリで、以下の手順で環境を作り直す

# 問答無用で既存の環境を消す
$ PIPENV_IGNORE_VIRTUALENVS=1 pipenv --rm

# pipenv 環境を作り直す
$ pipenv sync
Creating a virtualenv for this project…
Pipfile: /Users/zenwerk/src/some-project/Pipfile
Using /usr/local/Cellar/pipenv/2018.11.26_2/libexec/bin/python3.7 (3.7.5) to create virtualenv…
⠏ Creating virtual environment...Already using interpreter /usr/local/Cellar/pipenv/2018.11.26_2/libexec/bin/python3.7

# 依存関係の再インストール
$ pipenv install --dev
5
1
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
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?