Hi Patrick, I think I might have the answer, although Michael Dickens could certainly provide better explanations and all that.
You need to check your environment variables. You can do that in the command line by typing "env". Normally you should see something like " PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Version/2.7/lib/python2.7/site-packages/:/opt/local/lib/:/usr/local/lib/ " in the output. Normally Macports should adapt your ~/.profile file in order to tell your system where Macports put the stuff you installed. If for some reasons that fails, your PYTHONPATH (in this case) will not point to the correct directories. If that indeed is the case, then you might insert some lines to your ~/.profile file, i.e. "export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/:/opt/local/lib/:/usr/local/lib/:$PYTHONPATH" and "export PATH="/opt/local/bin:/opt/local/sbin:$PATH"" at the end of that file. You might want to make sure that you can find PyQT4 yourself in those given directories. For example my PyQT4 folder is under "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages" After you inserted those lines to your .profile, you just need to open a new terminal, and you can again check via "env" if that worked out. Regards, Kevin Am 07.09.15 um 18:29 schrieb Patrick Krämer: > Hi everybody, > > I installed GNURadio on a fresh machine with Mac OS X 10.10.5 via MacPorts. I > now have 2 Python installs in /usr/bin, python2.6 and python2.7. Running > flowgraphs with GRC is no problem. However, when trying to run a .py-file > from the terminal, as suggested in the guided tutorial 3.1 („if else“) some > modules are not found: > > Patricks-iMac:work patrick$ python if_else_mod.py > Traceback (most recent call last): > File "if_else_mod.py", line 18, in <module> > from PyQt4 import Qt > ImportError: No module named PyQt4 > > > Why does it work, when running the file from GRC? Is my terminal using the > wrong python install? How could I change that? I also tried changing the path > variable on my notebook a few days ago, when I ran into the same problem. But > since I am new to python and the command line I obviously made a mistake so > that at some point I could not start the GRC anymore. So your help is > appreciated and needed. Couldn’t find a similar question in the archives. > > Thank you. > Patrick > > > > > > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio