0

I have Ubuntu 11.10, and I have always run python just fine. However I have run into a problem. I was trying to get jpeg working with PIL and I did something and now python won't run from the command line. Earlier it said change PYTHONPATH AND PYTHONHOME and also gave me and ImportError: No module named site. So I set PYTHONPATH AND PYTHONHOME to /usr/local/lib/python2.7 and now I only get the 'No module named site'. So still python not working from command line. I've found out a little bit about site from http://www.doughellmann.com/PyMOTW/site/, but I cannot figure out how to remedy this problem. Thanks!

9
  • Unset those variables and start over? Commented Apr 2, 2012 at 4:34
  • How did you install PIL? Commented Apr 2, 2012 at 4:37
  • I unset and tried python again. Now Iimport site 'm back to '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' Commented Apr 2, 2012 at 4:38
  • 2
    You might want to run sudo apt-get install --reinstall python to fix the system Python. Commented Apr 2, 2012 at 4:43
  • 2
    You have more than one version of Python on your system, and one is broken. Either expand your question detailing the did something part, or the commands that you typed so we can help. Like this everyone is guessing. Commented Apr 2, 2012 at 4:49

1 Answer 1

2

You can export PYTHONPATH=/path/to/your/dir

Sign up to request clarification or add additional context in comments.

1 Comment

Shouldn't it be PYTHONHOME?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.