2

I started using Ubuntu recently and it has been a mess. I must have manually installed something important in a directory I shouldn't have.

The other day I was deleting useless files that have accumulated on my PC. After that python keeps on giving me this message:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
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 tried some other questions that explain how to reinstall Python, but that didn't help. I also tried updating/upgrading, didn't help. I don't know what to check even to understand what I need to do to fix this.

For what it is worth, here is some output that is suspicious:

when running which python:

/home/d3ath/Enthought/Canopy_64bit/User/bin/python

python2.7 still seems to exist: ls /usr/bin/python:

python            python2.7-config  python3.4         python-config     
python2           python2-config    python3.4m        pythontex         
python2.7         python3           python3m          pythontex3
Zanna
  • 70,465
Pana
  • 41
  • 1
    Try reinstalling python. That should get your file back. If that works I'll add this as an answer. Or is there some reason why you can't do that? – sylphyk Jan 22 '17 at 02:59
  • Reinstalling was the first thing I did and it doesn't help. – Pana Jan 22 '17 at 03:58

2 Answers2

2

Ok, so the problem is resolved (for the most part).

I checked my $PATH, and found that I had appended the path /home/d3ath/Enthought/Canopy_64bit/User/bin to the start. Naturally it execute the python found in there first rather than the one in /usr/bin/ as it should. If anything the moral of the story is be careful what you do to your path.

I say "for the most part" because I don't know if whatever caused the python to fail the first time will be an import package I need to execute some of my py-code. I will have to find out and correct as I go.

Zanna
  • 70,465
Pana
  • 41
0

I had this happen when I uninstalled anaconda (which was using 3.4GB disk space) by deleting the anaconda directory and then installed miniconda (which takes 773MB) in the same terminal window.

So I went back to basics...

I removed miniconda and deleted the config lines from .bashrc, and then closed that window and opened a new one to install miniconda.

After installing I then closed that window and opened another, after which it worked properly.

prowla
  • 59
  • 4