Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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...

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

1 Answer 1

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
2  
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 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 Dec 21 '12 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. –  Shutupsquare 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 setup.py file. –  Timo Dec 21 '12 at 11:40

Your Answer

 
discard

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.