I've tried everything I can but now I need help! I've hit the limit of what I do understand.
My error:
andytmac:~ admin$ lsvirtualenv
andytmac:~ admin$ mkvirtualenv test
-bash: /usr/local/bin/virtualenv: /usr/bin/python: bad interpreter: No such file or directory
My take is that virtualenv doesn't know where python is. Is this the case? How can I fix this?
System is Mac OSX 10.9.4
I have used brew to install python 2.7.8.1.
- Python 2.7*something* was on there but I removed it. I can't remember exactly what I did to do that however. Sorry. I am new to macs.
- This new python instance sits here: /usr/local/Cellar/python/2.7.8_1/
- The /usr/local/bin/python
file when I readlink /usr/local/bin/python it points to the above
.bash_profile:
export PROJECT_HOME=$HOME/Projects
export PATH=$PATH:/usr/local/bin
export PATH=$PATH:/usr/local/bin/psql
export PYTHONPATH=$PYTHONPATH:/usr/local/bin/python
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
alias showhidden='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
alias hidehidden='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder'
Paths:
andytmac:~ admin$ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
Python seems to work but path looks busy
Python 2.7.8 (default, Aug 24 2014, 21:26:19)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-5.4.2-py2.7.egg', '/usr/local/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg', '/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg', '/usr/local/lib/python2.7/site-packages/setuptools-5.4.2-py2.7.egg', '/Users/admin', '/usr/local/Cellar/python/2.7.8_1', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']
Any help appreciated!
Thanks,
Andy
This is going badly..... Help! Not least because I have messed up the links, I think there is a problem with these links
andytmac:~ admin$ ln -s /usr/bin/python /System/Library/Frameworks/Python.framework/Versions/2.7
ln: /System/Library/Frameworks/Python.framework/Versions/2.7: Permission denied
andytmac:~ admin$ sudo ln -s /usr/bin/python /System/Library/Frameworks/Python.framework/Versions/2.7
Password:
andytmac:~ admin$ readlink /System/Library/Frameworks/Python.framework/Versions/2.7
/usr/bin/python
andytmac:~ admin$ readlink /usr/bin/python
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
andytmac:~ admin$ sudo ln - s /usr/local/Cellar/python/2.7.8_1/ user/bin/python
ln: user/bin/python: No such file or directory
andytmac:~ admin$ sudo ln - s /usr/local/Cellar/python/2.7.8_1 /usr/bin/python
ln: /usr/bin/python: Too many levels of symbolic links
andytmac:~ admin$ readlink /usr/bin/python
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
andytmac:~ admin$ sudo ln - s /usr/local/Cellar/python/2.7.8_1 /System/Library/Frameworks/Python.framework/Versions/2.7
ln: /System/Library/Frameworks/Python.framework/Versions/2.7: Too many levels of symbolic links
andytmac:~ admin$ python
I thought I had it. I changed the links as follows. But it's still screwed.
Andytmac:~ admin$ readlink /System/Library/Frameworks/Python.framework/Versions/Current
/System/Library/Frameworks/Python.framework/Versions/2.7
Andytmac:~ admin$ readlink /System/Library/Frameworks/Python.framework/Versions/2.7
/usr/bin/python
Andytmac:~ admin$ readlink /usr/bin/python
/usr/local/Cellar/python/2.7.8_1
Andytmac:~ admin$ virtualenv ENV
-bash: /usr/local/bin/virtualenv: /usr/bin/python: bad interpreter: Permission denied
Andytmac:~ admin$
I'd better stop now before I do any more damage.
I changed /usr/bin/python to point to /usr/local/Cellar/python/2.7.8_1/bin python2.7:
Andytmac:~ admin$ readlink /usr/bin/python
/usr/local/Cellar/python/2.7.8_1/bin/python2.7
No the error has evolved to the below:
Andytmac:~ admin$ lsvirtualenv
Andytmac:~ admin$ mkvirtualenv Test
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2876, in <module>
File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 451, in _build_master
File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 464, in _build_from_requirements
File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 639, in resolve
pkg_resources.DistributionNotFound: virtualenv==1.10.1