pyinstaller command rejects --add-data flag in command line, works in .spec file - Windows 10

42 views
Skip to first unread message

Amir Katz

unread,
Jul 16, 2019, 10:37:54 AM7/16/19
to PyInstaller
I tried this command (which does work fine w/o the --add-data option):

    (venv-374) pyinstaller --path .\venv-374\lib\site-packages --add-data 'resources:resources' .\notification-tool.py

and I get this error:

    pyinstaller: error: argument --add-data: invalid add_data_or_binary value: 'resources:resources'

When I added this in the .spec file, I was able to add my files:

    datas=[('resources', 'resources')],

If this is a known bug, apologies in advance.

Thanks,
Amir

Hartmut Goebel

unread,
Jul 16, 2019, 10:41:12 AM7/16/19
to pyins...@googlegroups.com
Am 16.07.19 um 16:14 schrieb Amir Katz:

    pyinstaller: error: argument --add-data: invalid add_data_or_binary value: 'resources:resources'


Please read the manual and use --help to learn about the correct syntax.


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

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

Blog: https://www.goe-con.de/blog/gemeinsam-die-gala-zur-verleihung-der-der-bigbrotherawards-gucken
Kolumne: https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2010-07-passwoerter-lieben-lernen

0x7B752811BF773B65.asc

Amir Katz

unread,
Jul 19, 2019, 2:00:19 PM7/19/19
to PyInstaller
Hartmut, thank you. A clear case of RTFM :-(. 
I saw an example somewhere that was using the ':' and they did not say it was for Linux (that's my excuse...)
Anyway, I did switch to using the spec file because I added it to git, with the rest of the project, so I don't have to remember the command line syntax every time.

ttepperg

unread,
Apr 10, 2020, 11:55:57 AM4/10/20
to PyInstaller
Hi,

I'm finding a related problem.

Pyinstaller v3.1 on Mac (Capitan) does not appear to have the --add-data option at all.

Typing, e.g.:

$> pyinstaller --add-data='myfile.txt' myscript.py

Fails with:

error: unrecognized arguments: --add-data=


Typing:

$> pyinstaller -h

indeed reveals that the option '--add-data' is not available under section
'what to bundle, where to search', in contrast to the documentation.

Any ideas?

Thanks.

Eric Fahlgren

unread,
Apr 10, 2020, 5:03:13 PM4/10/20
to pyins...@googlegroups.com
PyInstaller v 3.1 is over four years old, so not too surprising that this option is missing.  Update your installation, "pip install --upgrade pyinstaller" and it should appear.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/8c1eb1e8-cd79-49f4-b355-95cc563f683f%40googlegroups.com.

abhishek bhatta

unread,
Apr 10, 2020, 5:04:34 PM4/10/20
to PyInstaller
Hello,

I believe the --add-data flag in the command line was introduced in a later version of pyinstaller. It should work in your .spec file with the "datas=" flag.

For more information visit: https://pypi.org/project/PyInstaller/3.1.1/

Regards,
Abhishek

Thorsten Tepper García

unread,
Apr 11, 2020, 3:56:50 PM4/11/20
to pyins...@googlegroups.com
Hi Abishek,

Thanks for your reply.
That works indeed as I had discovered early.

Cheers,

-----------------------------------------------
Dr. Thorsten Tepper García
Astrophysicist
www.thorsten.mx
> --
> You received this message because you are subscribed to the Google Groups "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/23d9dca5-06f6-4533-9f4f-0a9218357ebf%40googlegroups.com.

Thorsten Tepper García

unread,
Apr 11, 2020, 3:57:41 PM4/11/20
to pyins...@googlegroups.com
Hi Eric,

Thanks for your answer.

> PyInstaller v 3.1 is over four years old, so not too surprising that this option is missing.
> Update your installation, "pip install --upgrade pyinstaller" and it should appear.
I see, my bad.

Sadly, version 3.1 is the most recent one available through MacPorts.
Based on my experience, is not a good idea to mix packages installed
via MacPorts and pip, so I’ll stick to the older version for now.

Thanks again!

Thor.

Hartmut Goebel

unread,
May 5, 2020, 6:44:34 AM5/5/20
to pyins...@googlegroups.com
Am 10.04.20 um 07:13 schrieb ttepperg:
Pyinstaller v3.1 on

Thi sis an outdated version. Please use acurrent one (3.6)

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

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

0x7B752811BF773B65.asc
Reply all
Reply to author
Forward
0 new messages