I accidentally deleted python folders I had on my machine - which is a macbook, running yosemite, version 10.10.2 (14C1510). I took them out of the trash, but when I try running python, I get this:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
I have read through forums and exported PYTHONHOME to usr/local using this:
export PYTHONHOME=usr/local
When I try running python now, I only get the last error:
ImportError: No module named site
I located the python2.7 folders - there were four of them and moved them to /usr/local/lib. Then I typed in:
export PYTHONHOME = /usr/local/lib/python2.7
It gave me the error:
-bash: export: =': not a valid identifier
-bash: export:
/usr/local/lib/python2.7': not a valid identifier
HELP!
thanks
PYTHONHOME should point to the directory of the standard python library. There are a couple of problems with what you are doing at the moment.
In terminal try using this command:
ls /usr/local/lib
Now look through the results for the correct python install that you wish to use. Now set your PYTHONHOME variable using
export PYTHONHOME=/usr/local/lib/pythonXXX
replacing the XXX to complete the desired path. Notice how the path contains a leading forward slash to make it an absolute path!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With