how to package embedded python?

D

David M. Cotter

what must i include in my app package if i'm embedding python?

i tried including *everything* in the "DLLs" directory, but my app still crashes as soon as i attempt to initialize python.

this is on a system that does not have python installed, as most of my users won't have it. is it actually a requirement that they first install python? (cuz it does work then)
 
D

David M. Cotter

does nobody know how to do this?
does nobody know where proper documentation on this is?
 
D

David M. Cotter

nooooooooooobody knoooooooooooowssss....
the trouble aaaaaaaaaaaaaaaaahhhh seeeeeeeeeeee.......
 
K

Kevin Walzer

what must i include in my app package if i'm embedding python?

i tried including *everything* in the "DLLs" directory, but my app still crashes as soon as i attempt to initialize python.

this is on a system that does not have python installed, as most of my users won't have it. is it actually a requirement that they first install python? (cuz it does work then)

Have you looked at these docs?

http://docs.python.org/2/extending/embedding.html

Lots of other hits on Google for ""embedding Python in C app."
 
D

David M. Cotter

yes, i've looked there, and all over google. i'm quite expert at embedding at this point.

however nowhere i have looked has had instructions for "this this is how you package up your .exe with all the necessary python modules necessary to actually run on a user's system that does not have python installed".

on mac, it's trivial: all macs come with python, there is nothing i need to include with my app and it "just works"

on windows: if you don't include the proper DLLs and/or whatnot, then the app will complain about missing DLLs on startup.

What DLLs must i include? where are the instructions?
 
C

CM

yes, i've looked there, and all over google. i'm quite expert at embedding at this point.



however nowhere i have looked has had instructions for "this this is how you package up your .exe with all the necessary python modules necessary toactually run on a user's system that does not have python installed".



on mac, it's trivial: all macs come with python, there is nothing i need to include with my app and it "just works"



on windows: if you don't include the proper DLLs and/or whatnot, then theapp will complain about missing DLLs on startup.



What DLLs must i include? where are the instructions?

I know nothing about embedding, but in terms of packaging up a Python interpreter with an application that needs it, could you use py2exe to do that? If, so is this helpful (gotten from Google's cache since page doesn't appear at the moment...later try embedded Python py2exe search)?:

http://webcache.googleusercontent.c...ed+&cd=2&hl=en&ct=clnk&gl=us&client=firefox-a
 
D

David M. Cotter

okay, well that might turn out to be useful, except i don't quite know how to use it, and there are no "from scratch" instructions.

i managed to download "py2exe-0.6.9.zip" and unzip it, but how does one "install" this package? (yes, still a newb at that)

then, once installed, how do i say "include the entire world" instead of just "mymodule" ? cuz the point of embedding python on my app is that the end-user can run any script at all, not just one module.
 
C

CM

okay, well that might turn out to be useful, except i don't quite know how to use it, and there are no "from scratch" instructions.



i managed to download "py2exe-0.6.9.zip" and unzip it, but how does one "install" this package? (yes, still a newb at that)

What's your OS? For Windows there is an exe that installs it. Did you download that?

Or you could, in the command line, do:

cd c:\some_folder\the_py2exe_folder
python setup.py install

(The Python site has a huge page of details on that route. http://docs.python.org/2/install/)

Or you could probably get away with just moving the py2exe folder to
Python27\site-packages (or whatever Python you have)

Or you could first install pip (recommended!) and then just:
pip install py2exe
(http://dubroy.com/blog/so-you-want-to-install-a-python-package)
then, once installed, how do i say "include the entire world" instead of just "mymodule" ? cuz the point of embedding python on my app is that the end-user can run any script at all, not just one module.

I don't know. As I understand it, py2exe will pull whatever is needed in Python to run your module. If your module requires all of Python, I guess that will work. I think regardless of the module, even if it is a "Hello, World" program, py2exe has to include the Python interpreter.

Unfortunately, and surprisingly, the py2exe site is still down. Odd. If it returns, that should help. There is also a py2exe users mailing list that you could find by Googling for it.



In terms of
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,172
Latest member
NFTPRrAgenncy
Top