[PYTHON] What to do if the Pipenv environment is corrupted by updating Homebrew

For example, when the following error occurs

$ 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

In the directory where Pipfile is located, recreate the environment by following the steps below.

#Erase the existing environment without asking questions
$ PIPENV_IGNORE_VIRTUALENVS=1 pipenv --rm

#Recreate the pipenv environment
$ 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

#Dependency reinstallation
$ pipenv install --dev

Recommended Posts

What to do if the Pipenv environment is corrupted by updating Homebrew
What to do if the inode is exhausted on EC2 Linux
What to do if you can't pipenv shell
What to do when the warning "The environment is in consistent ..." appears in the Anaconda environment
What to do if (base) is displayed at the beginning of the Mac terminal
pipenv shell is no longer available ... what to do?
What to do if pyenv is not enabled (zsh)
What to do if the progress bar is not displayed in tqdm of python
What to do if the package dependency cannot be repaired
What to do if pip gives a DistributionError in Homebrew
What to do if yum breaks
What to do if the image is not displayed using matplotlib etc. in the Docker container
What to do if "Unnamed: 0" is added in to_csv-> read_csv in pandas
What to do if you can't use the trash in Lubuntu 18.04.
What to do when the value type is ambiguous in Python?
What to do if you cat or tail a binary file and the terminal is garbled
What to do if the user name is changed and the pyenv library path does not pass
What to do if there is a decimal in python json .dumps
What to do when the result downloaded via scrapy is in English
What to do if the yum command fails to set locale, defaulting to C
What to do if the Chainer (Windows) sample mnist terminates with WinError 183.
What to do if the server doesn't start with python manage.py runserver
What to do if you can't install with pip in babun environment
What to do when psycopg2 throws an error when pipenv lock under Pipenv environment
What to do if you get a "No versions found" error in pipenv
What to do if CERTIFICATE_VERIFY_FAILED occurs when nltk.download () is done on macOS pyhon
What to do if pipreqs results in UnicodeDecodeError
What to do if the latest Jupyter Notebook and nb extensions don't work
What to do if you installed pyenv on Mac OS using Homebrew but the python version doesn't switch
Note: What to do if pip install fails
What to do if mod_fcgid cannot resolve UnicodeEncodeError
Let's Encrypt updated! What to do if the certbot renew command doesn't work
What to do if rails s doesn't work
[Note] What to do if the Qt library conflicts between pyqt and opencv
What to do if pip cannot be installed
What to do if atom autocomplete-python doesn't work
What to do if abort is displayed when inputting camera video in OpenCV
What to do if Docker-sync suddenly stops working
If you want to enter the virtual environment with jupyter, nb_conda_kernels is recommended
What to do if a version error occurs in the selenium Chrome driver
What to do if "amazon-linux-extras" → "No module named amazon_linux_extras"
What to do if Japanese language support is not completely installed on Ubuntu 16.04
What happens to the access log when the website is automatically accessed by selenium-webdriver
What to do if ubuntu says your password is too short to change [passwd command] [ubuntu]
What to do when is not in the sudoers file.This incident will be reported.
What to do if the Microsoft Store opens even if you run python on Windows
What to do when only the window is displayed and nothing is displayed in pygame Note
What to do if the print command itself causes an error in Maya python
What to do if Python IntelliSense is not displayed in VS Code on Windows
[Introduction to Python] What is the important "if __name__ =='__main__':" when dealing with modules?
What to do if Python does not switch from the System version in pyenv
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
What to do if you can't hit the arrow keys in the Python interactive console
What to do if pip install fails in Xcode 5.1
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 if SciPy installation fails on CentOS
What to do if a UnicodeDecodeError occurs in pip
What I did to ssh to the VPS Ubuntu environment