Re: [PyInstaller] Python library not found on linux

4,549 views
Skip to first unread message

Martin Zibricky

unread,
Jun 5, 2012, 8:34:31 AM6/5/12
to pyins...@googlegroups.com
Sarbjit singh píše v Út 05. 06. 2012 v 04:49 -0700:
> ./configure --prefix=<location of install> --enable-shared=disabled

This is wrong configuration. You need --enable-shared=enabled

> make
> make install

sarbjit

unread,
Jun 5, 2012, 8:35:33 AM6/5/12
to pyins...@googlegroups.com

I tried rebuilding it with ./configure --prefix=<location of install> --enable-shared

Now after this i didn't got same error while running pyinstaller but was getting error:

python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

So i set the env variable as LD_LIBRARY_PATH as <python install>/lib

After that python works fine and i was able to generate exe but now on running exe, i am getting following error:

Error loading Python lib '<path>/libpython2.7.so.1.0':  <path>libpython2.7.so.1.0: cannot open shared object file: No such file or directory

sarbjit

unread,
Jun 5, 2012, 8:47:32 AM6/5/12
to pyins...@googlegroups.com

I copied /libpython2.7.so.1.0 to the directory where exe was build. So when i execute exe, it doesn't report error for it now, but some other errors:

od is NULL - structTraceback (most recent call last):
  File "<path>/python2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
mod is NULL - archiveTraceback (most recent call last):
  File "<path>/pyinstaller-1.5.1/archive.py", line 42, in <module>
    import struct
ImportError: No module named struct
Traceback (most recent call last):
  File "<string>", line 25, in <module>
ImportError: No module named archive
 

Martin Zibricky

unread,
Jun 5, 2012, 8:51:40 AM6/5/12
to pyins...@googlegroups.com
sarbjit píše v Út 05. 06. 2012 v 05:35 -0700:
> After that python works fine and i was able to generate exe but now on
> running exe, i am getting following error:
>
> Error loading Python lib '<path>/libpython2.7.so.1.0':
> <path>libpython2.7.so.1.0: cannot open shared object file: No such
> file or directory

It means pyinstaller was not able to find libpython from your custom
python 2.7. Try copy it manually to your dist directory.

sarbjit

unread,
Jun 5, 2012, 8:55:57 AM6/5/12
to pyins...@googlegroups.com

I did copied libpython2.7.1so.1.0 in dist, but now on executing exe i am getting below messages :

mod is NULL - structTraceback (most recent call last):

  File "<path>/python2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
mod is NULL - archiveTraceback (most recent call last):
  File "<path>/pyinstaller-1.5.1/archive.py", line 42, in <module>
    import struct
ImportError: No module named struct
Traceback (most recent call last):
  File "<string>", line 25, in <module>
ImportError: No module named archive


I am new to such configurations, can you please help?


Martin Zibricky

unread,
Jun 5, 2012, 9:22:44 AM6/5/12
to pyins...@googlegroups.com
sarbjit píše v Út 05. 06. 2012 v 05:55 -0700:
> File "<string>", line 25, in <module>
> ImportError: No module named archive
>
>
> I am new to such configurations, can you please help?

Please try development version.

sarbjit

unread,
Jun 5, 2012, 9:27:34 AM6/5/12
to pyins...@googlegroups.com
Thanks Martin for your help. I have been able to fix this problem somehow (did some clean build and path cleanup).

One question i have regarding this utility, i have one python script say test.py. I ran pyinstaller as "python pyinstaller.py ../test.py". Now i noticed that a test folder is created having build and dist folder.

Could you please tell me significance of the folders?

Also i noticed there are lot of files inside the dist folder along with test exe, Can i only copy this exe and run without these files or there is a way to generate a single exe only?
Reply all
Reply to author
Forward
0 new messages