“python (filename) build” command not working
up vote
0
down vote
favorite
I have installed cx_Freeze using the command python -m pip install cx_Freeze --upgrade
.
After that I set the cmd directory to the folder that contains my .py file, and I typed python scratch.py build
, but instead of compiling my code into an exe, it simply ran my code in the command line.
How would I go about fixing this?
python
add a comment |
up vote
0
down vote
favorite
I have installed cx_Freeze using the command python -m pip install cx_Freeze --upgrade
.
After that I set the cmd directory to the folder that contains my .py file, and I typed python scratch.py build
, but instead of compiling my code into an exe, it simply ran my code in the command line.
How would I go about fixing this?
python
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have installed cx_Freeze using the command python -m pip install cx_Freeze --upgrade
.
After that I set the cmd directory to the folder that contains my .py file, and I typed python scratch.py build
, but instead of compiling my code into an exe, it simply ran my code in the command line.
How would I go about fixing this?
python
I have installed cx_Freeze using the command python -m pip install cx_Freeze --upgrade
.
After that I set the cmd directory to the folder that contains my .py file, and I typed python scratch.py build
, but instead of compiling my code into an exe, it simply ran my code in the command line.
How would I go about fixing this?
python
python
asked Nov 11 at 0:57
Marthinus_
1
1
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
That's not what the python
command does.
Python is conceptually pretty simple to use. You've explored two ways to use it so far:
python -m pip ...
runs the python module calledpip
, passing everything in the...
as arguments to that script.python scratch.py ...
runs the filescratch.py
, passing everything in the...
as arguments to that script.
What you're doing here, then, is running the script scratch.py
with the argument build
- which probably doesn't mean anything to the program, so it just gets ignored. The script pip
(which actually exists as its own executable already; you can do pip ...
without the python -m
) has special behaviors set up for when install
is given as an argument to it, and so on.
If you want to build an .exe
file out of your code, you'll have to look into tools that can do that for you, such as PyInstaller and py2exe. You may find This article helpful, as it elaborates more on these tools.
1
Thank you! I have tried pyinstaller and it works perfectly!
– Marthinus_
Nov 11 at 1:36
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
That's not what the python
command does.
Python is conceptually pretty simple to use. You've explored two ways to use it so far:
python -m pip ...
runs the python module calledpip
, passing everything in the...
as arguments to that script.python scratch.py ...
runs the filescratch.py
, passing everything in the...
as arguments to that script.
What you're doing here, then, is running the script scratch.py
with the argument build
- which probably doesn't mean anything to the program, so it just gets ignored. The script pip
(which actually exists as its own executable already; you can do pip ...
without the python -m
) has special behaviors set up for when install
is given as an argument to it, and so on.
If you want to build an .exe
file out of your code, you'll have to look into tools that can do that for you, such as PyInstaller and py2exe. You may find This article helpful, as it elaborates more on these tools.
1
Thank you! I have tried pyinstaller and it works perfectly!
– Marthinus_
Nov 11 at 1:36
add a comment |
up vote
0
down vote
That's not what the python
command does.
Python is conceptually pretty simple to use. You've explored two ways to use it so far:
python -m pip ...
runs the python module calledpip
, passing everything in the...
as arguments to that script.python scratch.py ...
runs the filescratch.py
, passing everything in the...
as arguments to that script.
What you're doing here, then, is running the script scratch.py
with the argument build
- which probably doesn't mean anything to the program, so it just gets ignored. The script pip
(which actually exists as its own executable already; you can do pip ...
without the python -m
) has special behaviors set up for when install
is given as an argument to it, and so on.
If you want to build an .exe
file out of your code, you'll have to look into tools that can do that for you, such as PyInstaller and py2exe. You may find This article helpful, as it elaborates more on these tools.
1
Thank you! I have tried pyinstaller and it works perfectly!
– Marthinus_
Nov 11 at 1:36
add a comment |
up vote
0
down vote
up vote
0
down vote
That's not what the python
command does.
Python is conceptually pretty simple to use. You've explored two ways to use it so far:
python -m pip ...
runs the python module calledpip
, passing everything in the...
as arguments to that script.python scratch.py ...
runs the filescratch.py
, passing everything in the...
as arguments to that script.
What you're doing here, then, is running the script scratch.py
with the argument build
- which probably doesn't mean anything to the program, so it just gets ignored. The script pip
(which actually exists as its own executable already; you can do pip ...
without the python -m
) has special behaviors set up for when install
is given as an argument to it, and so on.
If you want to build an .exe
file out of your code, you'll have to look into tools that can do that for you, such as PyInstaller and py2exe. You may find This article helpful, as it elaborates more on these tools.
That's not what the python
command does.
Python is conceptually pretty simple to use. You've explored two ways to use it so far:
python -m pip ...
runs the python module calledpip
, passing everything in the...
as arguments to that script.python scratch.py ...
runs the filescratch.py
, passing everything in the...
as arguments to that script.
What you're doing here, then, is running the script scratch.py
with the argument build
- which probably doesn't mean anything to the program, so it just gets ignored. The script pip
(which actually exists as its own executable already; you can do pip ...
without the python -m
) has special behaviors set up for when install
is given as an argument to it, and so on.
If you want to build an .exe
file out of your code, you'll have to look into tools that can do that for you, such as PyInstaller and py2exe. You may find This article helpful, as it elaborates more on these tools.
answered Nov 11 at 1:30
Green Cloak Guy
2,321720
2,321720
1
Thank you! I have tried pyinstaller and it works perfectly!
– Marthinus_
Nov 11 at 1:36
add a comment |
1
Thank you! I have tried pyinstaller and it works perfectly!
– Marthinus_
Nov 11 at 1:36
1
1
Thank you! I have tried pyinstaller and it works perfectly!
– Marthinus_
Nov 11 at 1:36
Thank you! I have tried pyinstaller and it works perfectly!
– Marthinus_
Nov 11 at 1:36
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%2f53244907%2fpython-filename-build-command-not-working%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