Pyinstaller adding data files
up vote
4
down vote
favorite
I'm struggling with pyinstaller, whenever I build this specific script with a kivy GUI and run the .exe after the build I get a fatal error that it couldn't perform the scrip. I ran it through the cmd and it give me the error: IOError: [Errno 2] No such file or directory: 'main.kv'
I've tried adding the .kv file as well as a mdb and dsn file (using pypyodbc in script) using --add-data when starting the build but in doing so I get an error: unrecognized arguments: --add-data'main.kv'
(The rest of the specified files for --add-data follows)
Are there any solutions for this or maybe alternative methods?
pyinstaller
add a comment |
up vote
4
down vote
favorite
I'm struggling with pyinstaller, whenever I build this specific script with a kivy GUI and run the .exe after the build I get a fatal error that it couldn't perform the scrip. I ran it through the cmd and it give me the error: IOError: [Errno 2] No such file or directory: 'main.kv'
I've tried adding the .kv file as well as a mdb and dsn file (using pypyodbc in script) using --add-data when starting the build but in doing so I get an error: unrecognized arguments: --add-data'main.kv'
(The rest of the specified files for --add-data follows)
Are there any solutions for this or maybe alternative methods?
pyinstaller
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I'm struggling with pyinstaller, whenever I build this specific script with a kivy GUI and run the .exe after the build I get a fatal error that it couldn't perform the scrip. I ran it through the cmd and it give me the error: IOError: [Errno 2] No such file or directory: 'main.kv'
I've tried adding the .kv file as well as a mdb and dsn file (using pypyodbc in script) using --add-data when starting the build but in doing so I get an error: unrecognized arguments: --add-data'main.kv'
(The rest of the specified files for --add-data follows)
Are there any solutions for this or maybe alternative methods?
pyinstaller
I'm struggling with pyinstaller, whenever I build this specific script with a kivy GUI and run the .exe after the build I get a fatal error that it couldn't perform the scrip. I ran it through the cmd and it give me the error: IOError: [Errno 2] No such file or directory: 'main.kv'
I've tried adding the .kv file as well as a mdb and dsn file (using pypyodbc in script) using --add-data when starting the build but in doing so I get an error: unrecognized arguments: --add-data'main.kv'
(The rest of the specified files for --add-data follows)
Are there any solutions for this or maybe alternative methods?
pyinstaller
pyinstaller
edited Aug 28 '17 at 21:57
Stéphane
4361523
4361523
asked Jan 26 '17 at 9:49
staos2
2515
2515
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
11
down vote
If you check pyinstaller -h
for help, you can find --add-data
option works like this [--add-data <SRC;DEST or SRC:DEST>]
. So in your case try
pyinstaller -F --add-data "main.kv;main.kv" yourtarget.py
2
Whether to use a semicolon or colon as the separator depends onos.pathsep
, i.e., on most *nix systems this is a colon and on Windows this should be a semicolon.
– schlimmchen
Oct 9 '17 at 13:14
with respect to the output dist/ folder, where did main.kv end up?
– bw4sz
Apr 11 at 16:13
man pyinstaller docs could make that more clear ... all the examples i found used:
... usually i just do it in the spec file but i really didnt want a spec file for this project
– Joran Beasley
May 17 at 0:08
add a comment |
up vote
1
down vote
The solution is to run: pyi-makespec yourscript.py
Then edit the yourscript.spec script and add the files under datas in a= Analysis.
datas=[ ( '/pathToYourFile/main.kv', '.' )]
then run pyinstaller yourscript.spec
should be good after that.
1
It shows too many values to unpack error.
– Harshit Agrawal
Apr 22 at 19:44
@HarshitAgrawal Add comma then: datas=[ ( '/pathToYourFile/main.kv', '.' )],
– pmus
Oct 31 at 0:40
@pmus I did tried with using commas too but didnt worked and showed the same error when I run the .exe file "too many values to unpack" error.
– Harshit Agrawal
Nov 3 at 11:18
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
11
down vote
If you check pyinstaller -h
for help, you can find --add-data
option works like this [--add-data <SRC;DEST or SRC:DEST>]
. So in your case try
pyinstaller -F --add-data "main.kv;main.kv" yourtarget.py
2
Whether to use a semicolon or colon as the separator depends onos.pathsep
, i.e., on most *nix systems this is a colon and on Windows this should be a semicolon.
– schlimmchen
Oct 9 '17 at 13:14
with respect to the output dist/ folder, where did main.kv end up?
– bw4sz
Apr 11 at 16:13
man pyinstaller docs could make that more clear ... all the examples i found used:
... usually i just do it in the spec file but i really didnt want a spec file for this project
– Joran Beasley
May 17 at 0:08
add a comment |
up vote
11
down vote
If you check pyinstaller -h
for help, you can find --add-data
option works like this [--add-data <SRC;DEST or SRC:DEST>]
. So in your case try
pyinstaller -F --add-data "main.kv;main.kv" yourtarget.py
2
Whether to use a semicolon or colon as the separator depends onos.pathsep
, i.e., on most *nix systems this is a colon and on Windows this should be a semicolon.
– schlimmchen
Oct 9 '17 at 13:14
with respect to the output dist/ folder, where did main.kv end up?
– bw4sz
Apr 11 at 16:13
man pyinstaller docs could make that more clear ... all the examples i found used:
... usually i just do it in the spec file but i really didnt want a spec file for this project
– Joran Beasley
May 17 at 0:08
add a comment |
up vote
11
down vote
up vote
11
down vote
If you check pyinstaller -h
for help, you can find --add-data
option works like this [--add-data <SRC;DEST or SRC:DEST>]
. So in your case try
pyinstaller -F --add-data "main.kv;main.kv" yourtarget.py
If you check pyinstaller -h
for help, you can find --add-data
option works like this [--add-data <SRC;DEST or SRC:DEST>]
. So in your case try
pyinstaller -F --add-data "main.kv;main.kv" yourtarget.py
edited Oct 9 '17 at 14:44
schlimmchen
13416
13416
answered May 17 '17 at 2:34
Anson Chan
11115
11115
2
Whether to use a semicolon or colon as the separator depends onos.pathsep
, i.e., on most *nix systems this is a colon and on Windows this should be a semicolon.
– schlimmchen
Oct 9 '17 at 13:14
with respect to the output dist/ folder, where did main.kv end up?
– bw4sz
Apr 11 at 16:13
man pyinstaller docs could make that more clear ... all the examples i found used:
... usually i just do it in the spec file but i really didnt want a spec file for this project
– Joran Beasley
May 17 at 0:08
add a comment |
2
Whether to use a semicolon or colon as the separator depends onos.pathsep
, i.e., on most *nix systems this is a colon and on Windows this should be a semicolon.
– schlimmchen
Oct 9 '17 at 13:14
with respect to the output dist/ folder, where did main.kv end up?
– bw4sz
Apr 11 at 16:13
man pyinstaller docs could make that more clear ... all the examples i found used:
... usually i just do it in the spec file but i really didnt want a spec file for this project
– Joran Beasley
May 17 at 0:08
2
2
Whether to use a semicolon or colon as the separator depends on
os.pathsep
, i.e., on most *nix systems this is a colon and on Windows this should be a semicolon.– schlimmchen
Oct 9 '17 at 13:14
Whether to use a semicolon or colon as the separator depends on
os.pathsep
, i.e., on most *nix systems this is a colon and on Windows this should be a semicolon.– schlimmchen
Oct 9 '17 at 13:14
with respect to the output dist/ folder, where did main.kv end up?
– bw4sz
Apr 11 at 16:13
with respect to the output dist/ folder, where did main.kv end up?
– bw4sz
Apr 11 at 16:13
man pyinstaller docs could make that more clear ... all the examples i found used
:
... usually i just do it in the spec file but i really didnt want a spec file for this project– Joran Beasley
May 17 at 0:08
man pyinstaller docs could make that more clear ... all the examples i found used
:
... usually i just do it in the spec file but i really didnt want a spec file for this project– Joran Beasley
May 17 at 0:08
add a comment |
up vote
1
down vote
The solution is to run: pyi-makespec yourscript.py
Then edit the yourscript.spec script and add the files under datas in a= Analysis.
datas=[ ( '/pathToYourFile/main.kv', '.' )]
then run pyinstaller yourscript.spec
should be good after that.
1
It shows too many values to unpack error.
– Harshit Agrawal
Apr 22 at 19:44
@HarshitAgrawal Add comma then: datas=[ ( '/pathToYourFile/main.kv', '.' )],
– pmus
Oct 31 at 0:40
@pmus I did tried with using commas too but didnt worked and showed the same error when I run the .exe file "too many values to unpack" error.
– Harshit Agrawal
Nov 3 at 11:18
add a comment |
up vote
1
down vote
The solution is to run: pyi-makespec yourscript.py
Then edit the yourscript.spec script and add the files under datas in a= Analysis.
datas=[ ( '/pathToYourFile/main.kv', '.' )]
then run pyinstaller yourscript.spec
should be good after that.
1
It shows too many values to unpack error.
– Harshit Agrawal
Apr 22 at 19:44
@HarshitAgrawal Add comma then: datas=[ ( '/pathToYourFile/main.kv', '.' )],
– pmus
Oct 31 at 0:40
@pmus I did tried with using commas too but didnt worked and showed the same error when I run the .exe file "too many values to unpack" error.
– Harshit Agrawal
Nov 3 at 11:18
add a comment |
up vote
1
down vote
up vote
1
down vote
The solution is to run: pyi-makespec yourscript.py
Then edit the yourscript.spec script and add the files under datas in a= Analysis.
datas=[ ( '/pathToYourFile/main.kv', '.' )]
then run pyinstaller yourscript.spec
should be good after that.
The solution is to run: pyi-makespec yourscript.py
Then edit the yourscript.spec script and add the files under datas in a= Analysis.
datas=[ ( '/pathToYourFile/main.kv', '.' )]
then run pyinstaller yourscript.spec
should be good after that.
answered Apr 18 '17 at 20:16
kaminsknator
450316
450316
1
It shows too many values to unpack error.
– Harshit Agrawal
Apr 22 at 19:44
@HarshitAgrawal Add comma then: datas=[ ( '/pathToYourFile/main.kv', '.' )],
– pmus
Oct 31 at 0:40
@pmus I did tried with using commas too but didnt worked and showed the same error when I run the .exe file "too many values to unpack" error.
– Harshit Agrawal
Nov 3 at 11:18
add a comment |
1
It shows too many values to unpack error.
– Harshit Agrawal
Apr 22 at 19:44
@HarshitAgrawal Add comma then: datas=[ ( '/pathToYourFile/main.kv', '.' )],
– pmus
Oct 31 at 0:40
@pmus I did tried with using commas too but didnt worked and showed the same error when I run the .exe file "too many values to unpack" error.
– Harshit Agrawal
Nov 3 at 11:18
1
1
It shows too many values to unpack error.
– Harshit Agrawal
Apr 22 at 19:44
It shows too many values to unpack error.
– Harshit Agrawal
Apr 22 at 19:44
@HarshitAgrawal Add comma then: datas=[ ( '/pathToYourFile/main.kv', '.' )],
– pmus
Oct 31 at 0:40
@HarshitAgrawal Add comma then: datas=[ ( '/pathToYourFile/main.kv', '.' )],
– pmus
Oct 31 at 0:40
@pmus I did tried with using commas too but didnt worked and showed the same error when I run the .exe file "too many values to unpack" error.
– Harshit Agrawal
Nov 3 at 11:18
@pmus I did tried with using commas too but didnt worked and showed the same error when I run the .exe file "too many values to unpack" error.
– Harshit Agrawal
Nov 3 at 11:18
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41870727%2fpyinstaller-adding-data-files%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown