ImportError: No module named _pysvn_2_7

288 views
Skip to first unread message

Joe

unread,
Jul 16, 2014, 8:26:40 AM7/16/14
to pyins...@googlegroups.com
Hello,

I have been successfully using pyinstaller to compile my python script into an executable within a directory, under Ubuntu 10.04. My executable uses python-svn (pysvn). In my working binary under Ubuntu 10.04 the pysvn is copied as pysvn._pysvn_2_6.so, as that pysvn was of version 2.6 and this works. When I temporarily move this file out of my directory, then I get the error 'Import Error: No module named _pysvn_2_6', and if I move that .so back, then everything works fine.

Now I have Ubuntu 14 and this have python 2.7. After I use pyinstaller and compile, this binary folder also contains a file pysvn._pysvn_2_7.so. However, when I try to run my exeuctable, I get the below error


Traceback (most recent call last):
  File "<string>", line 22, in <module>
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller-2.1-py2.7.egg/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/joe/build/binary/out00-PYZ.pyz/pysvn", line 99, in <module>
ImportError: No module named _pysvn_2_7


If I rename my pysvn._pysvn_2_7.so to just _pysvn_2_7.so, then I get the error:

Traceback (most recent call last):
  File "<string>", line 22, in <module>
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller-2.1-py2.7.egg/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/joe/build/binary/out00-PYZ.pyz/pysvn", line 99, in <module>
SystemError: dynamic module not initialized properly

My python file itself (without compilation using pyinstaller), works correctly without any issues.

So it is not clear where the problem is. Is it in pysvn or is there something with pyinstaller and Ubuntu 14 x86_64.

Best Regards,  
Joe.



Hartmut Goebel

unread,
Jul 28, 2014, 6:48:17 AM7/28/14
to pyins...@googlegroups.com
Am 16.07.2014 14:26, schrieb Joe:
Now I have Ubuntu 14 and this have python 2.7. After I use pyinstaller and compile, this binary folder also contains a file pysvn._pysvn_2_7.so. However, when I try to run my exeuctable, I get the below error

I assume the quickest way to find the real problem is running you application under strace:

strace -o /tmp/trace.txt -f -e trace=file YourApplication


--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/1.-platz-bei-google-ganz-ohne-seo
Kolumne: http://www.cissp-gefluester.de/2011-11-in-troja-nichts-neues

Goebel Consult ist Mitglied bei http://www.7-it.de/

Joe

unread,
Sep 16, 2014, 9:58:05 AM9/16/14
to pyins...@googlegroups.com
Hello,
 
Following is the trace.txt file output.
 
execve("./svnspx", ["./svnspx"], [/* 38 vars */]) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libtsocks.so", O_RDONLY|O_CLOEXEC) = 3
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
stat64("/lib/ld-lsb.so.3", 0xbfc4eef8)  = -1 ENOENT (No such file or directory)
readlink("./svnspx", 0xbfc4ca2c, 1024)  = -1 EINVAL (Invalid argument)
getcwd("/home/svnspx/dist/svnspx", 4096) = 35
lstat64("/home/svnspx/dist/svnspx/svnspx", {st_mode=S_IFREG|0755, st_size=1308329, ...}) = 0
open("/home/svnspx/dist/svnspx/svnspx", O_RDONLY) = 3
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=10848, si_status=255, si_utime=8, si_stime=0} ---
+++ exited with 255 +++
 
Best Regards,
Joe.
Reply all
Reply to author
Forward
0 new messages