I recently installed a bunch of dotfiles on my Mac along with some other applications (I changed to iTerm instead of Terminal, and Sublime as my default text editor) but eve
What fixed it for me was just uninstalling python3 and pipenv then reinstalling them.
brew uninstall pipenv
brew uninstall python3
brew install python3
brew install pipenv
I recently faced this. None of the above solutions worked for me. Seems it wasn't actually Python's problem. When I was running
aws s3 ls
I was getting following error:
dyld: Library not loaded: @executable_path/../.Python
This means, the library aws
executable is pointing towards is either doesn't exist or is corrupted, thus I uninstalled and reinstalled aws-cli
following instructions from this link and it worked!!
After trying a few things, this worked for me:
go to your virtualenv directory (but don't run workon):
cd ~/.virtualenv/name_of_broken_venv
Now delete these files:
rm -rf .Python bin/python* lib/python2.7/* include/python2.7
Then to rebuild your venv, run:
virtualenv .
workon name_of_broken_venv
pip freeze
You should now see a list of your installed packages again.
Using Python 2.7.10.
A single command virtualenv path-to-env
does it. documentation
$ virtualenv path-to-env
Overwriting path-to-env/lib/python2.7/orig-prefix.txt with new content
New python executable in path-to-env/bin/python2.7
Also creating executable in path-to-env/bin/python
Installing setuptools, pip, wheel...done.
I came across the same issue when I was pointing my python run time from 2 to 3 on my mac, pointing the alias python to python 3 path. I then recreate a new virtualenv and re-install those packages i need for my project. For my use case i have had a python program writing to google sheet. Clean up a few packages that are different from python 2 implementation and wa la, things started working again.
All the answers are great here, I tried a couple of solutions mentioned above by Ryan, Chris and couldn't resolve the issue, so had to follow a quick and dirty way.
rm -rf <project dir>
(or mv <project dir> <backup projct dir>
if you want to keep a backup)git clone <project git url>
Nothing novel here, but it makes life easier!