Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ubuntu] ImportError: No module named publisher #401

Closed
ckorn opened this issue Nov 4, 2015 · 13 comments
Closed

[Ubuntu] ImportError: No module named publisher #401

ckorn opened this issue Nov 4, 2015 · 13 comments

Comments

@ckorn
Copy link

ckorn commented Nov 4, 2015

On Ubuntu 15.10 there is an error when starting version 1.16.0 of pyfa:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/cx_Freeze/initscripts/Console.py", line 27, in <module>
    exec code in m.__dict__
  File "pyfa.py", line 104, in <module>
  File "/home/korn/packages/pyfa/pyfa-1.16.0/service/__init__.py", line 13, in <module>
    from service.crest import Crest
  File "/home/korn/packages/pyfa/pyfa-1.16.0/service/crest.py", line 10, in <module>
    from wx.lib.pubsub import pub
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/pub.py", line 35, in <module>
    from .core import (
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/core/__init__.py", line 45, in <module>
    from .publisher import Publisher
ImportError: No module named publisher

This is the strace output:

open("/usr/games/../lib/pyfa-1.16.0/library.zip", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
_llseek(6, 3325952, [3325952], SEEK_SET) = 0
read(6, "T\353u\323$\31\253\10\305\230l\300\2\243\331\252=\250\3H\221\7u\267\234$?\352h\242\214\346"..., 1680) = 1680
read(6, "PK\3\4\24\0\0\0\10\0\301\241[B\277O\23\265q\0\0\0\226\0\0\0\23\0\0\0wx"..., 4096) = 4096
_llseek(6, 3331728, [3331728], SEEK_SET) = 0
_llseek(6, 3331728, [3331728], SEEK_SET) = 0
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib", 0xffcbee08) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx", 0xffcbee08) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip", {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
open("/usr/games/../lib/pyfa-1.16.0/library.zip", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
_llseek(6, 3661824, [3661824], SEEK_SET) = 0
read(6, "$T\31F\34\350\357\3165\372A\377\345\250\247Z\365\315\33\215\372[\247\201~\230\340\373X\264\367\32"..., 2499) = 2499
read(6, "PK\3\4\24\0\0\0\10\0\207\252$Dv\2530\4\20\1\0\0u\1\0\0\32\0\0\0wx"..., 4096) = 4096
_llseek(6, 3668419, [3668419], SEEK_SET) = 0
_llseek(6, 3668419, [3668419], SEEK_SET) = 0
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib/pubsub", 0xffcbedc8) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib", 0xffcbedc8) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx", 0xffcbedc8) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip", {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
open("/usr/games/../lib/pyfa-1.16.0/library.zip", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
_llseek(6, 3690496, [3690496], SEEK_SET) = 0
read(6, "\372\333\345\214\246\250\330\321\267\321R\352H3\315\"%\343\2516r\354\275T\32232R\36\3260\323"..., 2125) = 2125
read(6, "PK\3\4\24\0\0\0\10\0Uq\220Cit\2\355y\5\0\0\5\r\0\0\25\0\0\0wx"..., 4096) = 4096
_llseek(6, 3696717, [3696717], SEEK_SET) = 0
_llseek(6, 3696717, [3696717], SEEK_SET) = 0
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
open("/usr/games/../lib/pyfa-1.16.0/library.zip", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
_llseek(6, 3661824, [3661824], SEEK_SET) = 0
read(6, "$T\31F\34\350\357\3165\372A\377\345\250\247Z\365\315\33\215\372[\247\201~\230\340\373X\264\367\32"..., 2827) = 2827
read(6, "PK\3\4\24\0\0\0\10\0Uq\220CK\237\34\303\256\3\0\0\270\6\0\0\37\0\0\0wx"..., 4096) = 4096
_llseek(6, 3668747, [3668747], SEEK_SET) = 0
_llseek(6, 3668747, [3668747], SEEK_SET) = 0
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
open("/usr/games/../lib/pyfa-1.16.0/library.zip", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
_llseek(6, 3690496, [3690496], SEEK_SET) = 0
read(6, "\372\333\345\214\246\250\330\321\267\321R\352H3\315\"%\343\2516r\354\275T\32232R\36\3260\323"..., 1754) = 1754
read(6, "PK\3\4\24\0\0\0\10\0Uq\220C\373\5$e;\1\0\0<\2\0\0\32\0\0\0wx"..., 4096) = 4096
_llseek(6, 3696346, [3696346], SEEK_SET) = 0
_llseek(6, 3696346, [3696346], SEEK_SET) = 0
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib/pubsub/core", 0xffcbe418) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib/pubsub", 0xffcbe418) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib", 0xffcbe418) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx", 0xffcbe418) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip", {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib/pubsub/core/kwargs", 0xffcbe4e8) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib/pubsub/core", 0xffcbe4e8) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib/pubsub", 0xffcbe4e8) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx/lib", 0xffcbe4e8) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip/wx", 0xffcbe4e8) = -1 ENOTDIR (Not a directory)
stat64("/usr/games/../lib/pyfa-1.16.0/library.zip", {st_mode=S_IFREG|0644, st_size=4194901, ...}) = 0
write(2, "Traceback (most recent call last"..., 35Traceback (most recent call last):
) = 35
write(2, "  File \"/usr/lib/pymodules/pytho"..., 93  File "/usr/lib/pymodules/python2.7/cx_Freeze/initscripts/Console.py", line 27, in <module>
) = 93
open("/usr/lib/pymodules/python2.7/cx_Freeze/initscripts/Console.py", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0755, st_size=1191, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
read(6, "#-------------------------------"..., 4096) = 1191
write(2, "    ", 4    )                     = 4
write(2, "exec code in m.__dict__\n", 24exec code in m.__dict__
) = 24
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
write(2, "  File \"pyfa.py\", line 104, in <"..., 40  File "pyfa.py", line 104, in <module>
) = 40
open("pyfa.py", O_RDONLY|O_LARGEFILE)   = -1 ENOENT (No such file or directory)
open("/usr/games/../lib/pyfa-1.16.0/pyfa/pyfa.py", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory)
open("/usr/games/../lib/pyfa-1.16.0/pyfa.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/games/../lib/pyfa-1.16.0/pyfa.zip/pyfa.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/games/../lib/pyfa-1.16.0/library.zip/pyfa.py", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory)
write(2, "  File \"/home/korn/packages/pyfa"..., 88  File "/home/korn/packages/pyfa/pyfa-1.16.0/service/__init__.py", line 13, in <module>
) = 88
open("/home/korn/packages/pyfa/pyfa-1.16.0/service/__init__.py", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0664, st_size=596, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
read(6, "from service.market import Marke"..., 4096) = 596
write(2, "    ", 4    )                     = 4
write(2, "from service.crest import Crest\n", 32from service.crest import Crest
) = 32
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
write(2, "  File \"/home/korn/packages/pyfa"..., 85  File "/home/korn/packages/pyfa/pyfa-1.16.0/service/crest.py", line 10, in <module>
) = 85
open("/home/korn/packages/pyfa/pyfa-1.16.0/service/crest.py", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0664, st_size=6927, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
read(6, "import thread\nimport config\nimpo"..., 4096) = 4096
write(2, "    ", 4    )                     = 4
write(2, "from wx.lib.pubsub import pub\n", 30from wx.lib.pubsub import pub
) = 30
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
write(2, "  File \"/usr/lib/python2.7/dist-"..., 97  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/pub.py", line 35, in <module>
) = 97
open("/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/pub.py", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=5684, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
read(6, "\"\"\"\nThis is the main entry-point"..., 4096) = 4096
write(2, "    ", 4    )                     = 4
write(2, "from .core import (\n", 20from .core import (
)   = 20
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
write(2, "  File \"/usr/lib/python2.7/dist-"..., 107  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/core/__init__.py", line 45, in <module>
) = 107
open("/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/core/__init__.py", O_RDONLY|O_LARGEFILE) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=2674, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf736a000
read(6, "\"\"\"\nCore package of pubsub, hold"..., 4096) = 2674
write(2, "    ", 4    )                     = 4
write(2, "from .publisher import Publisher"..., 33from .publisher import Publisher
) = 33
close(6)                                = 0
munmap(0xf736a000, 4096)                = 0
write(2, "ImportError", 11ImportError)             = 11
write(2, ": ", 2: )                       = 2
write(2, "No module named publisher", 25No module named publisher) = 25
write(2, "\n", 1
)                       = 1
close(3)                                = 0
rt_sigaction(SIGINT, {SIG_DFL, [], 0}, {0xf73b5830, [], 0}, 8) = 0
close(4)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++
@blitzmann
Copy link
Collaborator

Can you open service/crest.py and before the from wx.lib.pubsub import pub add from wx.lib.pubsub import setupkwargs. This import is supposedly required sometimes for some reason (it works for me on my Debian tests, I guess it depends on how wxPython is built for the distro?)

@ckorn
Copy link
Author

ckorn commented Nov 5, 2015

That did not work for me:

$ pyfa 
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/cx_Freeze/initscripts/Console.py", line 27, in <module>
    exec code in m.__dict__
  File "pyfa.py", line 104, in <module>
  File "/home/korn/packages/pyfa/pyfa-1.16.0/service/__init__.py", line 13, in <module>
  File "/home/korn/packages/pyfa/pyfa-1.16.0/service/crest.py", line 11, in <module>
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/pub.py", line 35, in <module>
    from .core import (
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/core/__init__.py", line 45, in <module>
    from .publisher import Publisher
ImportError: No module named publisher

@blitzmann
Copy link
Collaborator

That is pretty strange. I see that you have wxPython 3.0, so I'm not sure what the problem is. I have an old Ubuntu VM that I can test out, I'll report back.

@ckorn
Copy link
Author

ckorn commented Nov 7, 2015

Also does not work with the -w switch in the new version:

$ pyfa -w
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/cx_Freeze/initscripts/Console.py", line 27, in <module>
    exec code in m.__dict__
  File "pyfa.py", line 104, in <module>
  File "/home/korn/packages/pyfa/new/pyfa-1.16.1/service/__init__.py", line 17, in <module>
    from service.server import StoppableHTTPServer, AuthHandler
  File "/home/korn/packages/pyfa/new/pyfa-1.16.1/service/server.py", line 8, in <module>
    from wx.lib.pubsub import pub
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/pub.py", line 35, in <module>
    from .core import (
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/core/__init__.py", line 45, in <module>
    from .publisher import Publisher
ImportError: No module named publisher

@blitzmann
Copy link
Collaborator

-w won't do anything if you don't actually have wxPython 2.8 installed.

I am not sure why this is happening to you. Can you post your /usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/lib/pubsub/core/__init__.py to pastebin? Also, make you try v1.16.1 - you stated in the OP that you were using v1.16.0

@ckorn
Copy link
Author

ckorn commented Nov 7, 2015

Here it is:
http://sprunge.us/gWQj

Tested with 1.16.1

@blitzmann
Copy link
Collaborator

No idea. I've tested with Ubuntu and Debian, and they both work for me. Perhaps there's an issue with your specific configuration. I've been thinking about switching from the pubsub stuff to wx events like the rest of the code. I liked the pubsub since we're dealing with the service layer here and not GUI, but it might be too much trouble.

Until then, the only thing I could recommend would be to try to reinstall wxpython, though I doubt that would do much.

@blitzmann
Copy link
Collaborator

I've converted the pubsub stuff to wx events, which should fix this. A release is being built now, please test and let me know. =)

@ckorn
Copy link
Author

ckorn commented Nov 14, 2015

Strange things happen here:

$ pyfa 
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/cx_Freeze/initscripts/Console.py", line 27, in <module>
    exec code in m.__dict__
  File "pyfa.py", line 99, in <module>
ImportError: dynamic module does not define init function (initwx)

Here is the build log:
http://sprunge.us/TUJH

I don't know what is going on here.

@blitzmann
Copy link
Collaborator

Are you trying to build a linux binary? pyfa's supposed to be run directly via python2.7 pyfa.py, don't run the setup script. =)

@ckorn
Copy link
Author

ckorn commented Nov 16, 2015

What is there a setup script for if you are not supposed to run it?

@blitzmann
Copy link
Collaborator

We only use it for building Windows binaries.

@ckorn
Copy link
Author

ckorn commented Nov 16, 2015

Ok, not using the setup.py works. Thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants