Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install a program written in Python / --><-- /

I did subversion checkout

svn checkout 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 
Traceback (most recent call last):
  File "", line 5, in <module>
    import py2exe
ImportError: No module named py2exe


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

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
No protocol specified
No protocol specified 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.

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

share|improve this question
Works fine for me actually on Ubuntu 12.10 64-bit. – Timo Dec 21 '12 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 Dec 21 '12 at 13:22
Hmmm, strange... I do have X. Unity works fine. It's a regular desktop computer. – Vlad K. Dec 21 '12 at 15:15
up vote 2 down vote accepted

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
share|improve this answer
py2exe is used to make a windows executable. It'll be of no use to a linux user. – Javier Rivera Dec 21 '12 at 8:11
Javier Rivera is right, and besides that, the command is wrong. It should be: python 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 Dec 21 '12 at 10:52
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. – squarebear Dec 21 '12 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 file. – Timo Dec 21 '12 at 11:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.