There has been quite a few installations of Python and Anacondas on my Mac over the years, and to some extent these have been neglected and I suspect now resurface and cause me issues.
I'd like to setup a virtualenv environment and did a pip install virtualenv. I'd like to create a new environement, Django18, for Django1.8, but after executing the command virtualenv Django18 I receive an error message:
OSError: Command ~/Desktop/Django18/bin/python - setuptools pip wheel failed with error code 1
bash_profile
# added by Anaconda2 4.2.0 installer
export PATH="~/anaconda2/bin:$PATH"
command: which python
~/anaconda2/bin/python
In /usr/bin/:
-rwxr-xr-x 2 root wheel 58416 Jul 15 2015 python
-rwxr-xr-x 5 root wheel 925 Sep 10 2014 python-config
lrwxr-xr-x 1 root wheel 75 Nov 9 2014 python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
lrwxr-xr-x 1 root wheel 82 Nov 9 2014 python2.6-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
lrwxr-xr-x 1 root wheel 75 Nov 9 2014 python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 root wheel 82 Nov 9 2014 python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
-rwxr-xr-x 2 root wheel 58416 Jul 15 2015 pythonw
lrwxr-xr-x 1 root wheel 76 Nov 9 2014 pythonw2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6
lrwxr-xr-x 1 root wheel 76 Nov 9 2014 pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
.profile
export PATH="/opt/local/lib/gmt4/bin:$PATH"
export PATH="~/teqc:$PATH"
export PATH="/usr/local/runpkr000:$PATH"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# MacPorts Installer addition on 2015-04-02_at_16:40:23: adding an appropriate PATH variable for use with MacPorts.
# export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
# added by Anaconda 2.3.0 installer
# export PATH="~/anaconda/bin:$PATH"
I suspect there needs to be some clearing up with this, but how can I resolve this error message and get virtualenv to work as expected? I have tried several methods already out there, but it's difficult for me to recognise what exactly in my case is causing this issue, before applying a potential remedy.
/opt/local/bin (is that macports installation)?:
lrwxr-xr-x 1 root admin 24 Oct 9 2016 python -> /opt/local/bin/python2.7
lrwxr-xr-x 1 root admin 31 Oct 9 2016 python-config -> /opt/local/bin/python2.7-config
lrwxr-xr-x 1 root admin 73 Dec 14 2014 python2.7 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 root admin 80 Dec 14 2014 python2.7-config -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
lrwxr-xr-x 1 root admin 25 Oct 9 2016 pythonw -> /opt/local/bin/pythonw2.7
lrwxr-xr-x 1 root admin 74 Dec 14 2014 pythonw2.7 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
/usr/Local/bin
lrwxr-xr-x 1 root staff 69 Dec 12 2012 python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3
lrwxr-xr-x 1 root staff 72 Dec 12 2012 python3-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3-32
lrwxr-xr-x 1 root staff 76 Dec 12 2012 python3-config -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3-config
lrwxr-xr-x 1 root staff 71 Dec 12 2012 python3.3 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3
lrwxr-xr-x 1 root staff 74 Dec 12 2012 python3.3-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3-32
lrwxr-xr-x 1 root staff 78 Dec 12 2012 python3.3-config -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3-config
lrwxr-xr-x 1 root staff 72 Dec 12 2012 python3.3m -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3m
lrwxr-xr-x 1 root staff 79 Dec 12 2012 python3.3m-config -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3m-config
lrwxr-xr-x 1 root staff 70 Dec 12 2012 pythonw3 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3
lrwxr-xr-x 1 root staff 73 Dec 12 2012 pythonw3-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3-32
lrwxr-xr-x 1 root staff 72 Dec 12 2012 pythonw3.3 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3.3
lrwxr-xr-x 1 root staff 75 Dec 12 2012 pythonw3.3-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3.3-32
import sys sys.path
~/anaconda2/lib/python27.zip
~/anaconda2/lib/python2.7
~/anaconda2/lib/python2.7/plat-darwin
~/anaconda2/lib/python2.7/plat-mac
~/anaconda2/lib/python2.7/plat-mac/lib-scriptpackages
~/anaconda2/lib/python2.7/lib-tk
~/anaconda2/lib/python2.7/lib-old
~/anaconda2/lib/python2.7/lib-dynload
~/anaconda2/lib/python2.7/site-packages
~/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.6-py2.7.egg
~/anaconda2/lib/python2.7/site-packages/aeosa
~/anaconda2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg
/opt/local/Library/Frameworks:
Python.framework
/System/Library/Frameworks
Python.framework
EDIT
which python
produces :
~/anaconda2/bin/python
which -a python
produces :
~/anaconda2/bin/python
/usr/bin/python
They're not the same. But then after deleting python installations in:
/opt/local/bin
/usr/Local/bin
/usr/bin
and using rm -rf python*
and sudo rm -rf python*
in
/opt/local/Library/Frameworks
the which
outputs then become the same.
I've realised that the which python
command actually refers to what is written in the .bash_profile
file and not .profile
(priority to .bash_profile).
In any case I commented out the $PATH
in my .bash_profile
, so forcing the environment variables only to be used in the .profile
file. Then source ~/.bash_profile
.
In my .profile
I added:
export PATH="/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages:$PATH
Then source ~/.profile
However after which python
I still get:
~/anaconda2/bin/python
This is getting a bit frustrating as even changing the relevant files and deleting certain python installations, the result is still the same :-/