I haven't tried yet out of fear I'll mess up more than I'll fix but I don't know if I can use PYTHONPATH to fix my problem. I've installed python 2.7.10 and python 3.4.2 on my Macbookpro. Python2.7 doesn't have problems, only 3.4 does. I'm afraid if I use PYTHONPATH to fix python3, it will affect python2.
Anyway, I've run:
sudo pip install blah2
sudo pip3 install blah3
pip freeze | grep blah2
blah2=2.12345
pip3 freeze | grep blah3
blah3=3.12345
and I can see I've installed the respective modules for python2 and python3 as pip freeze has shown. However, I keep getting errors when running scripts from cmd line for python 3.4 that say the module isn't found.
On further investigation using sys.path in my script, I can see python3 from cmd line is looking for modules at
/usr/local/lib/python3.4/site-packages
which doesn't have anything inside of it, whereas Idle for python 3.4 is looking at
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages
which has tons of files in there.
I don't know why this got messed up in the first place or what I forgot to do to mess it up like this but how do I tell python 3.4 to look at the /Library location for modules?
The funny thing is both python2 and 3 were installed from tar/gzip files. I ran both using the
configure; make ;make install
command but for some reason python2 is fine but python3 isn't.