1

I'm trying to install a program written in Python / -->http://code.google.com/p/amphetype/<-- /

I did subversion checkout

svn checkout http://amphetype.googlecode.com/svn/trunk/ amphetype-read-only


and tried to setup / run the program, but I am seeing ImportErrors like that:

pm@machina-pm:/home/pn/amphetype-read-only$ python setup.py 
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    import py2exe
ImportError: No module named py2exe


and:

pm@machina-pm:/home/pn/amphetype-read-only$ python Amphetype.py 
Traceback (most recent call last):
  File "Amphetype.py", line 10, in <module>
    from Config import Settings
  File "/home/pn/amphetype-read-only/Config.py", line 5, in <module>
    from QtUtil import *
  File "/home/pn/amphetype-read-only/QtUtil.py", line 4, in <module>
    from PyQt4.QtCore import *
ImportError: No module named PyQt4.QtCore


EDIT:
installing python-qt (sudo apt-get install python-qt4) helped in getting rid of the second ImportError.
However program still doesn't start, now it says:

pm@machina-pm:/home/pn/amphetype$ python Amphetype.py
No protocol specified
No protocol specified
Amphetype.py: cannot connect to X server :0


PS. readme.txt that goes with the source code sadly doesn't get me very far (author says that it was developed under windows, and the whole project seems to be abandoned now). I used to use that software on Windows and I like it a lot, and would love to get it running on Linux.

EDIT 2:
Ufff...
It works at last, moving the amphetype directory from ~/amphetype to /etc/amphetype did the trick, although I'm not sure why...

3
  • Works fine for me actually on Ubuntu 12.10 64-bit.
    – Timo
    Commented Dec 21, 2012 at 13:22
  • What computer are you running it on? 'cannot connect to X server' sounds like you're running it on a server or something without a graphical environment.
    – Thomas K
    Commented Dec 21, 2012 at 13:22
  • Hmmm, strange... I do have X. Unity works fine. It's a regular desktop computer.
    – Vlad K.
    Commented Dec 21, 2012 at 15:15

1 Answer 1

2

py2exe can only run on windows so I don't know how you can get round that. Maybe using wine.

you can get round the ImportError: No module named PyQt4.QtCore by installing python-qt4

sudo apt-get install python-qt4
4
  • 2
    py2exe is used to make a windows executable. It'll be of no use to a linux user. Commented Dec 21, 2012 at 8:11
  • Javier Rivera is right, and besides that, the command is wrong. It should be: python setup.py install or build instead of install depending on what you want. Also note that there's a readme.txt which will get you going.
    – Timo
    Commented Dec 21, 2012 at 10:52
  • 1
    Thanks @Timo please tell me how you think that making windows executables on Linux is useless. I can think of cases where it will be great for me at least.
    – squareborg
    Commented Dec 21, 2012 at 11:10
  • Hmm, my comment is maybe a bit misplaced. It could easily go under the question. Well, apparently py2exe produces invalid binaries when run under Wine. Atleast when I looked it up, maybe it got fixed by now. But still, just to run the program, you don't need to install it, and definatly no need to compile it into a Windows binary. It's a badly written setup.py file.
    – Timo
    Commented Dec 21, 2012 at 11:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .