I had python 2.7.3
and ipython 1.2
up and running correctly on my Linux
system (ubuntu 12.04
) but was trying to install an updated version of matplotlab needed for coursework.
After running this code line in the terminal
user$ sudo easy_install -U distribute user$ export PYTHONHOME=/usr/lib/python2.7/
now every time I try and run python
or ipython
I get the error message
ImportError: no module named site
how do I reverse/fix this problem?? I'm so lost. I looked at other similar issues, but no one else used Linux
and I'm not sure what to do.
TRY to unset your python path...
In Linux/Mac, you can use these commands:
unset PYTHONPATH unset PYTHONHOME
PYTHONHOME
Change the location of the standard Python libraries. By default, the libraries are searched in prefix/lib/pythonversion and exec_prefix/lib/pythonversion, where prefix and exec_prefix are installation-dependent directories, both defaulting to /usr/local.
When PYTHONHOME is set to a single directory, its value replaces both prefix and exec_prefix. To specify different values for these, set PYTHONHOME to prefix:exec_prefix.
Try to clean up your PYTHONHOME
:
user$ export PYTHONHOME=
As for installing matplotlib, I would recommend the following:
sudo apt-get install python-matplotlib
(details here)
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