How to add data files when using the command pyinstaller.py

670 views
Skip to first unread message

Laurence Anthony

unread,
May 19, 2012, 12:54:18 PM5/19/12
to pyins...@googlegroups.com
Hi all,
I have been enjoying using pyinstaller.py (the new alternative interface for using PyInstaller).

I've had no problem setting things like --onefile, --noconsole etc., but I'm now trying to add things like additional files to the long command line string (bypassing spec files). Is this possible?

What I'm trying to do is add everything I need to a single external tools configuration in Eclipse. Then, I'll be able to create what I want with a single click. Here's what I have so far:
"c:\pyinstaller.py"
--out=${parent-path}
--onefile
--noconsole
--icon=${parent-path}/icon.ico
${resource_loc}

Any ideas?

Laurence.

Martin Zibricky

unread,
May 20, 2012, 7:23:31 AM5/20/12
to pyins...@googlegroups.com
Laurence Anthony píše v Ne 20. 05. 2012 v 01:54 +0900:
>
> Hi all, I have been enjoying using pyinstaller.py (the new alternative
> interface for using PyInstaller).
>
> I've had no problem setting things like --onefile, --noconsole etc.,
> but I'm now trying to add things like additional files to the long
> command line string (bypassing spec files). Is this possible?

It should be possible creating files. with command line arguments it's
not yet possible. It should be implemented but nobody did that yet.
You are more than welcome to do so.

Martin

Laurence Anthony

unread,
May 20, 2012, 7:56:10 AM5/20/12
to pyins...@googlegroups.com
Thank you for the quick response. I'll look into it. IMOH, pyinstaller.py seems the way forward for building executables.

But, I've now run into a related question. With Portable Python, I'm struggling to return the os.environ['_MEIPASS2'] value to access additional files.

I'm getting nothing returned, even though I can see the tmp folder (with everything correctly inside) and also running debug=True in the build is showing that _MEIPASS2 is set correctly.

Actually, os.environ['PYTHONPATH'] and os.environ['PYTHONHOME'] return nothing either.

Any ideas?
Laurence.


Martin

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To post to this group, send email to pyins...@googlegroups.com.
To unsubscribe from this group, send email to pyinstaller...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyinstaller?hl=en.


Laurence Anthony

unread,
May 20, 2012, 8:31:53 AM5/20/12
to pyins...@googlegroups.com
Hi again,

I've now got a solution which is to use sys.path[0]. This gives the same value as os.environ['_MEIPASS2'].

But, I really don't understand why the  os.environ values are not being set.

Any ideas?

Laurence.

Martin Zibricky

unread,
May 20, 2012, 1:36:04 PM5/20/12
to pyins...@googlegroups.com
Laurence Anthony píše v Ne 20. 05. 2012 v 21:31 +0900:
Please use development version. With the development version you should
be able to get the right directory with data files from

sys._meipass

or

sys.prefix

Reply all
Reply to author
Forward
0 new messages