Hello,
I'm trying to package my python program into a linux executable using
cx_freeze. The goal is that the user should require python on their
system.
I've managed to make the binaries on Fedora Core 6 and they run fine.
However, when I move to Ubuntu (tested on Ubuntu Server 7.04 and
xUbuntu Desktop 7.04), the program fails to run with the following
error:
ImportError: no module named _md5
_md5 being imported by the hashlib module because the import of
_hashlib.so failed.
When I try to import the _hashlib module manually, I see that it
cannot find libssl.so.6 (The _hashlib module in the standard python
installation which came with Ubuntu works just fine). If I manually
copy the libssl.so.6 file from FC6 (its really a symlink pointing to
libssl.so.0.9.8b) to Ubuntu and make the symlink in /lib, it works
fine (the next error is related to libcrypto, libxslt and libjpeg (i'm
also using libxml, libxsl and PIL in my application).
I've scoured the net and it seems that _hashlib.so is dynamically
linked to libssl which is not being "integrated" into the build by
cx_Freeze. Similarly, there are other files with the same problem.
Does anyone have any idea how to make cx_Freeze make a linux
executable which is portable across *nix distros?
Thanks in advance,
-Prateek Sureka 8 7683
Prateek wrote:
I'm trying to package my python program into a linux executable
using cx_freeze. The goal is that the user should require python
on their system.
I've managed to make the binaries on Fedora Core 6 and they run
fine. However, when I move to Ubuntu (tested on Ubuntu Server 7.04
and xUbuntu Desktop 7.04), the program fails to run with the
following error:
I'm sorry I cannot help, but how many linux distros have no python
installed or no packages of it?
Regards,
Björn
--
BOFH excuse #151:
Some one needed the powerstrip, so they pulled the switch plug.
On 24 Okt, 14:20, Bjoern Schliessmann <usenet-
mail-0306.20.chr0n...@spamgourmet.comwrote:
>
I'm sorry I cannot help, but how many linux distros have no python
installed or no packages of it?
It's not usually the absence of Python that's the problem. What if
your application uses various extension modules which in turn rely on
various libraries (of the .so or .a kind)? It may be more convenient
to bundle all these libraries instead of working out the package
dependencies for all the target distributions, even if you know them
all.
Paul
Paul Boddie wrote:
It's not usually the absence of Python that's the problem. What if
your application uses various extension modules which in turn rely
on various libraries (of the .so or .a kind)? It may be more
convenient to bundle all these libraries instead of working out
the package dependencies for all the target distributions, even if
you know them all.
True, thanks for clarification.
Regards,
Björn
--
BOFH excuse #218:
The UPS doesn't have a battery backup.
On 24 Okt, 16:10, Bjoern Schliessmann <usenet-
mail-0306.20.chr0n...@spamgourmet.comwrote:
Paul Boddie wrote:
It's not usually the absence of Python that's the problem. What if
your application uses various extension modules which in turn rely
on various libraries (of the .so or .a kind)? It may be more
convenient to bundle all these libraries instead of working out
the package dependencies for all the target distributions, even if
you know them all.
True, thanks for clarification.
Any suggestions, then? ;-)
I've also run into similar issues with cx_Freeze: I wanted to package
a game written using PyGame, which itself requires some SDL libraries,
which in turn require different libraries like smpeg (if I remember
correctly). It gets to the point where one is effectively building a
Python distribution (another question asked recently but not answered
sufficiently), which has minimal linkage to other libraries - perhaps
the system C libraries, some X11 libraries, and nothing more. Some
ideas about doing that successfully (perhaps LSB enters the picture)
would be quite useful.
Paul
On Oct 24, 5:25 pm, Paul Boddie <p...@boddie.org.ukwrote:
On 24 Okt, 14:20, Bjoern Schliessmann <usenet-
mail-0306.20.chr0n...@spamgourmet.comwrote:
I'm sorry I cannot help, but how many linux distros have no python
installed or no packages of it?
It's not usually the absence of Python that's the problem. What if
your application uses various extension modules which in turn rely on
various libraries (of the .so or .a kind)? It may be more convenient
to bundle all these libraries instead of working out the package
dependencies for all the target distributions, even if you know them
all.
Paul
Thanks Paul,
So I've bundled all the extension modules (cx_Freeze helped me out
with that). Here is what I did:
if sys.platform.startswith("linux"):
import [add a bunch of imports here]
This import statement immediately imports all modules which will be
required. Hence, cx_Freeze is easily able to find them and I can put
all the .so files with the distro.
The problem is that some of these .so files (_hashlib.so) are hard-
linked to /lib/libssl.so and /lib/libcrypto.so. I cannot simply just
copy those (libssl/libcrypto) files into the distribution folder (and
cx_Freeze won't do anything about them because they are not Python
modules). I need a way to figure out how to get _hashlib.so to refer
to a libssl.so which is in the same directory (I would have thunk that
it should use the PATH environment variable - apparently not).
This seems to be a simple enough problem, doesn't it??
NB: Has the community come up with a better way to distribute Python
executables on linux? I'd also like to hear from folks who've got
linux distributables of medium to large scale python programs...
On Oct 24, 5:08 pm, Prateek <sure...@gmail.comwrote:
On Oct 24, 5:25 pm, Paul Boddie <p...@boddie.org.ukwrote:
On 24 Okt, 14:20, Bjoern Schliessmann <usenet-
mail-0306.20.chr0n...@spamgourmet.comwrote:
I'm sorry I cannot help, but how many linux distros have no python
installed or no packages of it?
It's not usually the absence of Python that's the problem. What if
your application uses various extension modules which in turn rely on
various libraries (of the .so or .a kind)? It may be more convenient
to bundle all these libraries instead of working out the package
dependencies for all the target distributions, even if you know them
all.
Paul
Thanks Paul,
So I've bundled all the extension modules (cx_Freeze helped me out
with that). Here is what I did:
if sys.platform.startswith("linux"):
import [add a bunch of imports here]
This import statement immediately imports all modules which will be
required. Hence, cx_Freeze is easily able to find them and I can put
all the .so files with the distro.
The problem is that some of these .so files (_hashlib.so) are hard-
linked to /lib/libssl.so and /lib/libcrypto.so. I cannot simply just
copy those (libssl/libcrypto) files into the distribution folder (and
cx_Freeze won't do anything about them because they are not Python
modules). I need a way to figure out how to get _hashlib.so to refer
to a libssl.so which is in the same directory (I would have thunk that
it should use the PATH environment variable - apparently not).
The environment variable you want is LD_LIBRARY_PATH.
Also, if you're not aware, the ldd command can print out the library
dependencies.
This seems to be a simple enough problem, doesn't it??
NB: Has the community come up with a better way to distribute Python
executables on linux? I'd also like to hear from folks who've got
linux distributables of medium to large scale python programs...
Since most Linux systems have Python installed these days, the impetus
isn't quite as strong, even given the issues brought up here.
Carl Banks
Paul Boddie wrote:
Any suggestions, then? ;-)
Not really; I've got a vaguely similar problem myself -- several
Debian systems with Python 2.4 and Python 2.5. But modules I need
(wxWidgets 2.8 and Twisted) aren't available as Python 2.5 packages
for Debian, so I'm stuck with 2.4. Packages from unstable won't
work because Twisted has a binary part that is linked against
another libc. I don't really want to compile and install manually
from tarballs everywhere, and building .deb packages with Python is
complicated.
Regards,
Björn
--
BOFH excuse #151:
Some one needed the powerstrip, so they pulled the switch plug. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: PatchFactory Support |
last post by:
Description:
Professional and easy-to-use patch building environment that can help
you to create instant patch packages for software and file updating.
Generated patch packages are small size...
|
by: Olaf Meyer |
last post by:
Sometimes if find it clumsy unsing the following approach building strings:
cmd = "%s -start %s -end %s -dir %s" % (executable, startTime, endTime,
directory)
Especially if you have a lot of...
|
by: John Hunter |
last post by:
I am trying to build python2.1 with alrge file support. I ran
configure in a clean build tree and then edited the makefile
# Compiler options
OPT= -ggdb -O3 -Wall -Wstrict-prototypes...
|
by: Edward Diener |
last post by:
I can install Python 2.4 on the Fedora 3 Linux system, but after I do a
number of Linux utilities and commands, like yum, stop working because
they were dependent on the Python 2.3 installation....
|
by: TPJ |
last post by:
Hello, I have another, probably stupid, question.
I'm working on some Python project, and I use some extensions written
in C. I do all the development on my GNU/Linux box, so my setup.py
script...
|
by: James Stroud |
last post by:
Hello All,
This is annoying. I am trying to build scipy right now but every .so
file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared"
to the ld flags.
Main Question: When...
|
by: Nirjhar Oberoi |
last post by:
Hi,
I am new to Linux and wanted to know how to use GCC to Compile the Code
written in C? I dont want to use EMacs or VI for my editor. Can you
suggest a good IDE for linux for C Programming..
...
|
by: Ramdas |
last post by:
How do I add users using Python scripts on a Linux machine?
Someone has a script?
|
by: Micah Elliott |
last post by:
Are there instructions somewhere on how to build Python (on linux)
statically? This seems like a common thing to do want to do, but my
searching isn't turning up much. If it is common, it would...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |