How can I run a Python 3 script?
I want to run a Python 3 script.
I have looked in the official doc and FAQ, and they are the typical loss. I was looking for answers, I ended up with more questions.
I have Windows and Linux. On Windows, I don't have Python. On Linux, I have Python, but it is Python 2.6.8. I have tried to run my script with this Python, but this gives an error.
I want something simple : a Python 3 that I would put somewhere in my disk and that I would use to run my script. Where can I find this ?
I am looking for a solution for Windows or Linux.
Thank you.
linux windows script python python3
add a comment |
I want to run a Python 3 script.
I have looked in the official doc and FAQ, and they are the typical loss. I was looking for answers, I ended up with more questions.
I have Windows and Linux. On Windows, I don't have Python. On Linux, I have Python, but it is Python 2.6.8. I have tried to run my script with this Python, but this gives an error.
I want something simple : a Python 3 that I would put somewhere in my disk and that I would use to run my script. Where can I find this ?
I am looking for a solution for Windows or Linux.
Thank you.
linux windows script python python3
1
Are you sure you do not have python3 installed on your linux box ? Several distros ship it but it is not the default python used to run scripts.
– NaeiKinDus
Jan 6 '15 at 11:02
@NaeiKinDus - No, I am not sure. I have tried the commandpython3but the command is not found.
– Nicolas Barbulesco
Jan 6 '15 at 11:10
1
you could try the following project for linux: code.google.com/p/pts-mini-gpl/wiki/StaticPython You can directly download the Python binary and run it without having to install it on your system.
– NaeiKinDus
Jan 6 '15 at 12:58
@NaeiKinDus - I have already managed to use the Portable Python suggested by Karel. But StaticPython is good to know.
– Nicolas Barbulesco
Jan 6 '15 at 13:09
add a comment |
I want to run a Python 3 script.
I have looked in the official doc and FAQ, and they are the typical loss. I was looking for answers, I ended up with more questions.
I have Windows and Linux. On Windows, I don't have Python. On Linux, I have Python, but it is Python 2.6.8. I have tried to run my script with this Python, but this gives an error.
I want something simple : a Python 3 that I would put somewhere in my disk and that I would use to run my script. Where can I find this ?
I am looking for a solution for Windows or Linux.
Thank you.
linux windows script python python3
I want to run a Python 3 script.
I have looked in the official doc and FAQ, and they are the typical loss. I was looking for answers, I ended up with more questions.
I have Windows and Linux. On Windows, I don't have Python. On Linux, I have Python, but it is Python 2.6.8. I have tried to run my script with this Python, but this gives an error.
I want something simple : a Python 3 that I would put somewhere in my disk and that I would use to run my script. Where can I find this ?
I am looking for a solution for Windows or Linux.
Thank you.
linux windows script python python3
linux windows script python python3
asked Jan 6 '15 at 10:58
Nicolas BarbulescoNicolas Barbulesco
2363716
2363716
1
Are you sure you do not have python3 installed on your linux box ? Several distros ship it but it is not the default python used to run scripts.
– NaeiKinDus
Jan 6 '15 at 11:02
@NaeiKinDus - No, I am not sure. I have tried the commandpython3but the command is not found.
– Nicolas Barbulesco
Jan 6 '15 at 11:10
1
you could try the following project for linux: code.google.com/p/pts-mini-gpl/wiki/StaticPython You can directly download the Python binary and run it without having to install it on your system.
– NaeiKinDus
Jan 6 '15 at 12:58
@NaeiKinDus - I have already managed to use the Portable Python suggested by Karel. But StaticPython is good to know.
– Nicolas Barbulesco
Jan 6 '15 at 13:09
add a comment |
1
Are you sure you do not have python3 installed on your linux box ? Several distros ship it but it is not the default python used to run scripts.
– NaeiKinDus
Jan 6 '15 at 11:02
@NaeiKinDus - No, I am not sure. I have tried the commandpython3but the command is not found.
– Nicolas Barbulesco
Jan 6 '15 at 11:10
1
you could try the following project for linux: code.google.com/p/pts-mini-gpl/wiki/StaticPython You can directly download the Python binary and run it without having to install it on your system.
– NaeiKinDus
Jan 6 '15 at 12:58
@NaeiKinDus - I have already managed to use the Portable Python suggested by Karel. But StaticPython is good to know.
– Nicolas Barbulesco
Jan 6 '15 at 13:09
1
1
Are you sure you do not have python3 installed on your linux box ? Several distros ship it but it is not the default python used to run scripts.
– NaeiKinDus
Jan 6 '15 at 11:02
Are you sure you do not have python3 installed on your linux box ? Several distros ship it but it is not the default python used to run scripts.
– NaeiKinDus
Jan 6 '15 at 11:02
@NaeiKinDus - No, I am not sure. I have tried the command
python3 but the command is not found.– Nicolas Barbulesco
Jan 6 '15 at 11:10
@NaeiKinDus - No, I am not sure. I have tried the command
python3 but the command is not found.– Nicolas Barbulesco
Jan 6 '15 at 11:10
1
1
you could try the following project for linux: code.google.com/p/pts-mini-gpl/wiki/StaticPython You can directly download the Python binary and run it without having to install it on your system.
– NaeiKinDus
Jan 6 '15 at 12:58
you could try the following project for linux: code.google.com/p/pts-mini-gpl/wiki/StaticPython You can directly download the Python binary and run it without having to install it on your system.
– NaeiKinDus
Jan 6 '15 at 12:58
@NaeiKinDus - I have already managed to use the Portable Python suggested by Karel. But StaticPython is good to know.
– Nicolas Barbulesco
Jan 6 '15 at 13:09
@NaeiKinDus - I have already managed to use the Portable Python suggested by Karel. But StaticPython is good to know.
– Nicolas Barbulesco
Jan 6 '15 at 13:09
add a comment |
4 Answers
4
active
oldest
votes
You have registered for Ask Ubuntu Q&A, so I'll provide the command for Ubuntu. In Ubuntu open the terminal and type:
sudo apt install python3 idle3
python3 is already installed by default in Ubuntu, I have added python3 to the command for the sake of generality with other Linux distributions. IDLE 3 is an Integrated Development Environment for Python 3. Open IDLE 3 and then open your Python script from the menu in IDLE 3 -> File -> Open.
In Windows IDLE 3 is bundled with the Python 3 installation file, and the instructions for opening a Python 3 script in IDLE 3 are the same.
You can also install Python 3 in Windows as a portable app. Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. Portable Python is available for both Python 2 and Python 3. The download options for Portable Python offer you a choice of downloading optional additional Python packages for scientific computing, etc. The installed size of Portable Python (Python 3), based on the selected packages, is between 63MB and 260MB.
On Windows, I did not succeed with the Python 3 installer. It asks me for admin auth, even when I choose to install "just for me".
– Nicolas Barbulesco
Jan 6 '15 at 11:27
On Linux, I don't want to run this kind of command. I have an integration server, and I don't want to install anything in the system. I want to have and use Python 3 in a folder.
– Nicolas Barbulesco
Jan 6 '15 at 11:31
Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. There is a way to run Python scripts as a regular user without administrative privileges in both Windows and Linux by running the scripts from the Python virtual environment creator (virtualenv). Using virtualenv will improve security when running untrusted Python scripts. You can also install Python 3 itself inside a virtualenv Python virtual environment. However you still need administrative privileges to install virtualenv.
– karel
Jan 6 '15 at 11:34
2
Portable Python for Python 3 is currently at version 3.2.5.1.
– karel
Jan 6 '15 at 11:37
Karel, I understand that Portable Python and virtualenv are two different things. I am interested in Portable Python !
– Nicolas Barbulesco
Jan 6 '15 at 11:39
|
show 1 more comment
On many systems, "python" defaults to "python2", but you can run a script under python 3 simply by doing
python3 myscript.py
Issuing
which python3
will tell you if that's going to work.
Also, if the script includes an appropriate shebang,
./myscript.py
is supposed to work...
On Linux, the commandpython3is not found. Neither on Windows.
– Nicolas Barbulesco
Jan 6 '15 at 11:06
Regarding launching the script with "./" , it fails : /usr/bin/env: python3: No file or folder of that type.
– Nicolas Barbulesco
Jan 6 '15 at 11:09
Then you definitely have to install python 3. I see you're discussing that in the comments to the other answers.
– Nemo
Jan 6 '15 at 14:50
add a comment |
For Windows:
- You need to install Python 3 from here
- Follow the setup instructions, making sure to check the box that says whether to add it to the system PATH variable
- Go into
cmd,cdto the location of the script, and typepython script.py, replacingscriptwith your filename or open the script with Python Launcher which will have been installed via the installer
To make the script, you can use Python IDLE which was also installed.
This link does not give Python 3, it gives an installer, .msi. Coming from the Mac, I am not fond of installing programs. Anyway, I have (re-)tried the installer, to no avail. Even when I choose to install "just for me", the installer asks me for admin auth, and it fails. Why can't those people just provide a Zip file ?
– Nicolas Barbulesco
Jan 6 '15 at 11:41
@NicolasBarbulesco So you want to run python without installing? Like a portable version??
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:43
Yes ! I am looking into @karel's solution.
– Nicolas Barbulesco
Jan 6 '15 at 11:45
1
OK, I didn't see @karel's comments - I agree about using Portable Python, it works fine on a USB for me :)
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:46
add a comment |
There is a difference from Linux to Windows.
On Linux you would type like this:
python3 script.py
While on Windows (once you have Python installed) chances are you would type:
py -3 script.py
Comparing to py -2 script.py that would run Python 2.
Note: On Windows python or python.exe would call the latest version of Python you have installed.
1
Huh, aren't the Windows binaries calledpython.exe? Where did you getpyfrom?
– slhck
Jan 11 at 12:58
I don't care, I just use it withpywhen I need to specify the version, butpythonorpython.exestill works.
– prosti
Jan 11 at 15:48
So it's not really required. That said, this seems to be a new feature with version 3.6: docs.python.org/3/using/windows.html
– slhck
Jan 11 at 21:21
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2fsuperuser.com%2fquestions%2f861255%2fhow-can-i-run-a-python-3-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have registered for Ask Ubuntu Q&A, so I'll provide the command for Ubuntu. In Ubuntu open the terminal and type:
sudo apt install python3 idle3
python3 is already installed by default in Ubuntu, I have added python3 to the command for the sake of generality with other Linux distributions. IDLE 3 is an Integrated Development Environment for Python 3. Open IDLE 3 and then open your Python script from the menu in IDLE 3 -> File -> Open.
In Windows IDLE 3 is bundled with the Python 3 installation file, and the instructions for opening a Python 3 script in IDLE 3 are the same.
You can also install Python 3 in Windows as a portable app. Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. Portable Python is available for both Python 2 and Python 3. The download options for Portable Python offer you a choice of downloading optional additional Python packages for scientific computing, etc. The installed size of Portable Python (Python 3), based on the selected packages, is between 63MB and 260MB.
On Windows, I did not succeed with the Python 3 installer. It asks me for admin auth, even when I choose to install "just for me".
– Nicolas Barbulesco
Jan 6 '15 at 11:27
On Linux, I don't want to run this kind of command. I have an integration server, and I don't want to install anything in the system. I want to have and use Python 3 in a folder.
– Nicolas Barbulesco
Jan 6 '15 at 11:31
Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. There is a way to run Python scripts as a regular user without administrative privileges in both Windows and Linux by running the scripts from the Python virtual environment creator (virtualenv). Using virtualenv will improve security when running untrusted Python scripts. You can also install Python 3 itself inside a virtualenv Python virtual environment. However you still need administrative privileges to install virtualenv.
– karel
Jan 6 '15 at 11:34
2
Portable Python for Python 3 is currently at version 3.2.5.1.
– karel
Jan 6 '15 at 11:37
Karel, I understand that Portable Python and virtualenv are two different things. I am interested in Portable Python !
– Nicolas Barbulesco
Jan 6 '15 at 11:39
|
show 1 more comment
You have registered for Ask Ubuntu Q&A, so I'll provide the command for Ubuntu. In Ubuntu open the terminal and type:
sudo apt install python3 idle3
python3 is already installed by default in Ubuntu, I have added python3 to the command for the sake of generality with other Linux distributions. IDLE 3 is an Integrated Development Environment for Python 3. Open IDLE 3 and then open your Python script from the menu in IDLE 3 -> File -> Open.
In Windows IDLE 3 is bundled with the Python 3 installation file, and the instructions for opening a Python 3 script in IDLE 3 are the same.
You can also install Python 3 in Windows as a portable app. Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. Portable Python is available for both Python 2 and Python 3. The download options for Portable Python offer you a choice of downloading optional additional Python packages for scientific computing, etc. The installed size of Portable Python (Python 3), based on the selected packages, is between 63MB and 260MB.
On Windows, I did not succeed with the Python 3 installer. It asks me for admin auth, even when I choose to install "just for me".
– Nicolas Barbulesco
Jan 6 '15 at 11:27
On Linux, I don't want to run this kind of command. I have an integration server, and I don't want to install anything in the system. I want to have and use Python 3 in a folder.
– Nicolas Barbulesco
Jan 6 '15 at 11:31
Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. There is a way to run Python scripts as a regular user without administrative privileges in both Windows and Linux by running the scripts from the Python virtual environment creator (virtualenv). Using virtualenv will improve security when running untrusted Python scripts. You can also install Python 3 itself inside a virtualenv Python virtual environment. However you still need administrative privileges to install virtualenv.
– karel
Jan 6 '15 at 11:34
2
Portable Python for Python 3 is currently at version 3.2.5.1.
– karel
Jan 6 '15 at 11:37
Karel, I understand that Portable Python and virtualenv are two different things. I am interested in Portable Python !
– Nicolas Barbulesco
Jan 6 '15 at 11:39
|
show 1 more comment
You have registered for Ask Ubuntu Q&A, so I'll provide the command for Ubuntu. In Ubuntu open the terminal and type:
sudo apt install python3 idle3
python3 is already installed by default in Ubuntu, I have added python3 to the command for the sake of generality with other Linux distributions. IDLE 3 is an Integrated Development Environment for Python 3. Open IDLE 3 and then open your Python script from the menu in IDLE 3 -> File -> Open.
In Windows IDLE 3 is bundled with the Python 3 installation file, and the instructions for opening a Python 3 script in IDLE 3 are the same.
You can also install Python 3 in Windows as a portable app. Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. Portable Python is available for both Python 2 and Python 3. The download options for Portable Python offer you a choice of downloading optional additional Python packages for scientific computing, etc. The installed size of Portable Python (Python 3), based on the selected packages, is between 63MB and 260MB.
You have registered for Ask Ubuntu Q&A, so I'll provide the command for Ubuntu. In Ubuntu open the terminal and type:
sudo apt install python3 idle3
python3 is already installed by default in Ubuntu, I have added python3 to the command for the sake of generality with other Linux distributions. IDLE 3 is an Integrated Development Environment for Python 3. Open IDLE 3 and then open your Python script from the menu in IDLE 3 -> File -> Open.
In Windows IDLE 3 is bundled with the Python 3 installation file, and the instructions for opening a Python 3 script in IDLE 3 are the same.
You can also install Python 3 in Windows as a portable app. Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. Portable Python is available for both Python 2 and Python 3. The download options for Portable Python offer you a choice of downloading optional additional Python packages for scientific computing, etc. The installed size of Portable Python (Python 3), based on the selected packages, is between 63MB and 260MB.
edited Mar 17 '18 at 18:54
answered Jan 6 '15 at 11:19
karelkarel
9,25293138
9,25293138
On Windows, I did not succeed with the Python 3 installer. It asks me for admin auth, even when I choose to install "just for me".
– Nicolas Barbulesco
Jan 6 '15 at 11:27
On Linux, I don't want to run this kind of command. I have an integration server, and I don't want to install anything in the system. I want to have and use Python 3 in a folder.
– Nicolas Barbulesco
Jan 6 '15 at 11:31
Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. There is a way to run Python scripts as a regular user without administrative privileges in both Windows and Linux by running the scripts from the Python virtual environment creator (virtualenv). Using virtualenv will improve security when running untrusted Python scripts. You can also install Python 3 itself inside a virtualenv Python virtual environment. However you still need administrative privileges to install virtualenv.
– karel
Jan 6 '15 at 11:34
2
Portable Python for Python 3 is currently at version 3.2.5.1.
– karel
Jan 6 '15 at 11:37
Karel, I understand that Portable Python and virtualenv are two different things. I am interested in Portable Python !
– Nicolas Barbulesco
Jan 6 '15 at 11:39
|
show 1 more comment
On Windows, I did not succeed with the Python 3 installer. It asks me for admin auth, even when I choose to install "just for me".
– Nicolas Barbulesco
Jan 6 '15 at 11:27
On Linux, I don't want to run this kind of command. I have an integration server, and I don't want to install anything in the system. I want to have and use Python 3 in a folder.
– Nicolas Barbulesco
Jan 6 '15 at 11:31
Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. There is a way to run Python scripts as a regular user without administrative privileges in both Windows and Linux by running the scripts from the Python virtual environment creator (virtualenv). Using virtualenv will improve security when running untrusted Python scripts. You can also install Python 3 itself inside a virtualenv Python virtual environment. However you still need administrative privileges to install virtualenv.
– karel
Jan 6 '15 at 11:34
2
Portable Python for Python 3 is currently at version 3.2.5.1.
– karel
Jan 6 '15 at 11:37
Karel, I understand that Portable Python and virtualenv are two different things. I am interested in Portable Python !
– Nicolas Barbulesco
Jan 6 '15 at 11:39
On Windows, I did not succeed with the Python 3 installer. It asks me for admin auth, even when I choose to install "just for me".
– Nicolas Barbulesco
Jan 6 '15 at 11:27
On Windows, I did not succeed with the Python 3 installer. It asks me for admin auth, even when I choose to install "just for me".
– Nicolas Barbulesco
Jan 6 '15 at 11:27
On Linux, I don't want to run this kind of command. I have an integration server, and I don't want to install anything in the system. I want to have and use Python 3 in a folder.
– Nicolas Barbulesco
Jan 6 '15 at 11:31
On Linux, I don't want to run this kind of command. I have an integration server, and I don't want to install anything in the system. I want to have and use Python 3 in a folder.
– Nicolas Barbulesco
Jan 6 '15 at 11:31
Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. There is a way to run Python scripts as a regular user without administrative privileges in both Windows and Linux by running the scripts from the Python virtual environment creator (virtualenv). Using virtualenv will improve security when running untrusted Python scripts. You can also install Python 3 itself inside a virtualenv Python virtual environment. However you still need administrative privileges to install virtualenv.
– karel
Jan 6 '15 at 11:34
Portable Python is pre-configured to run directly on the Windows OS from any USB storage device, enabling you to have, at any time, a portable programming environment. There is a way to run Python scripts as a regular user without administrative privileges in both Windows and Linux by running the scripts from the Python virtual environment creator (virtualenv). Using virtualenv will improve security when running untrusted Python scripts. You can also install Python 3 itself inside a virtualenv Python virtual environment. However you still need administrative privileges to install virtualenv.
– karel
Jan 6 '15 at 11:34
2
2
Portable Python for Python 3 is currently at version 3.2.5.1.
– karel
Jan 6 '15 at 11:37
Portable Python for Python 3 is currently at version 3.2.5.1.
– karel
Jan 6 '15 at 11:37
Karel, I understand that Portable Python and virtualenv are two different things. I am interested in Portable Python !
– Nicolas Barbulesco
Jan 6 '15 at 11:39
Karel, I understand that Portable Python and virtualenv are two different things. I am interested in Portable Python !
– Nicolas Barbulesco
Jan 6 '15 at 11:39
|
show 1 more comment
On many systems, "python" defaults to "python2", but you can run a script under python 3 simply by doing
python3 myscript.py
Issuing
which python3
will tell you if that's going to work.
Also, if the script includes an appropriate shebang,
./myscript.py
is supposed to work...
On Linux, the commandpython3is not found. Neither on Windows.
– Nicolas Barbulesco
Jan 6 '15 at 11:06
Regarding launching the script with "./" , it fails : /usr/bin/env: python3: No file or folder of that type.
– Nicolas Barbulesco
Jan 6 '15 at 11:09
Then you definitely have to install python 3. I see you're discussing that in the comments to the other answers.
– Nemo
Jan 6 '15 at 14:50
add a comment |
On many systems, "python" defaults to "python2", but you can run a script under python 3 simply by doing
python3 myscript.py
Issuing
which python3
will tell you if that's going to work.
Also, if the script includes an appropriate shebang,
./myscript.py
is supposed to work...
On Linux, the commandpython3is not found. Neither on Windows.
– Nicolas Barbulesco
Jan 6 '15 at 11:06
Regarding launching the script with "./" , it fails : /usr/bin/env: python3: No file or folder of that type.
– Nicolas Barbulesco
Jan 6 '15 at 11:09
Then you definitely have to install python 3. I see you're discussing that in the comments to the other answers.
– Nemo
Jan 6 '15 at 14:50
add a comment |
On many systems, "python" defaults to "python2", but you can run a script under python 3 simply by doing
python3 myscript.py
Issuing
which python3
will tell you if that's going to work.
Also, if the script includes an appropriate shebang,
./myscript.py
is supposed to work...
On many systems, "python" defaults to "python2", but you can run a script under python 3 simply by doing
python3 myscript.py
Issuing
which python3
will tell you if that's going to work.
Also, if the script includes an appropriate shebang,
./myscript.py
is supposed to work...
answered Jan 6 '15 at 11:02
NemoNemo
6781629
6781629
On Linux, the commandpython3is not found. Neither on Windows.
– Nicolas Barbulesco
Jan 6 '15 at 11:06
Regarding launching the script with "./" , it fails : /usr/bin/env: python3: No file or folder of that type.
– Nicolas Barbulesco
Jan 6 '15 at 11:09
Then you definitely have to install python 3. I see you're discussing that in the comments to the other answers.
– Nemo
Jan 6 '15 at 14:50
add a comment |
On Linux, the commandpython3is not found. Neither on Windows.
– Nicolas Barbulesco
Jan 6 '15 at 11:06
Regarding launching the script with "./" , it fails : /usr/bin/env: python3: No file or folder of that type.
– Nicolas Barbulesco
Jan 6 '15 at 11:09
Then you definitely have to install python 3. I see you're discussing that in the comments to the other answers.
– Nemo
Jan 6 '15 at 14:50
On Linux, the command
python3 is not found. Neither on Windows.– Nicolas Barbulesco
Jan 6 '15 at 11:06
On Linux, the command
python3 is not found. Neither on Windows.– Nicolas Barbulesco
Jan 6 '15 at 11:06
Regarding launching the script with "./" , it fails : /usr/bin/env: python3: No file or folder of that type.
– Nicolas Barbulesco
Jan 6 '15 at 11:09
Regarding launching the script with "./" , it fails : /usr/bin/env: python3: No file or folder of that type.
– Nicolas Barbulesco
Jan 6 '15 at 11:09
Then you definitely have to install python 3. I see you're discussing that in the comments to the other answers.
– Nemo
Jan 6 '15 at 14:50
Then you definitely have to install python 3. I see you're discussing that in the comments to the other answers.
– Nemo
Jan 6 '15 at 14:50
add a comment |
For Windows:
- You need to install Python 3 from here
- Follow the setup instructions, making sure to check the box that says whether to add it to the system PATH variable
- Go into
cmd,cdto the location of the script, and typepython script.py, replacingscriptwith your filename or open the script with Python Launcher which will have been installed via the installer
To make the script, you can use Python IDLE which was also installed.
This link does not give Python 3, it gives an installer, .msi. Coming from the Mac, I am not fond of installing programs. Anyway, I have (re-)tried the installer, to no avail. Even when I choose to install "just for me", the installer asks me for admin auth, and it fails. Why can't those people just provide a Zip file ?
– Nicolas Barbulesco
Jan 6 '15 at 11:41
@NicolasBarbulesco So you want to run python without installing? Like a portable version??
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:43
Yes ! I am looking into @karel's solution.
– Nicolas Barbulesco
Jan 6 '15 at 11:45
1
OK, I didn't see @karel's comments - I agree about using Portable Python, it works fine on a USB for me :)
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:46
add a comment |
For Windows:
- You need to install Python 3 from here
- Follow the setup instructions, making sure to check the box that says whether to add it to the system PATH variable
- Go into
cmd,cdto the location of the script, and typepython script.py, replacingscriptwith your filename or open the script with Python Launcher which will have been installed via the installer
To make the script, you can use Python IDLE which was also installed.
This link does not give Python 3, it gives an installer, .msi. Coming from the Mac, I am not fond of installing programs. Anyway, I have (re-)tried the installer, to no avail. Even when I choose to install "just for me", the installer asks me for admin auth, and it fails. Why can't those people just provide a Zip file ?
– Nicolas Barbulesco
Jan 6 '15 at 11:41
@NicolasBarbulesco So you want to run python without installing? Like a portable version??
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:43
Yes ! I am looking into @karel's solution.
– Nicolas Barbulesco
Jan 6 '15 at 11:45
1
OK, I didn't see @karel's comments - I agree about using Portable Python, it works fine on a USB for me :)
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:46
add a comment |
For Windows:
- You need to install Python 3 from here
- Follow the setup instructions, making sure to check the box that says whether to add it to the system PATH variable
- Go into
cmd,cdto the location of the script, and typepython script.py, replacingscriptwith your filename or open the script with Python Launcher which will have been installed via the installer
To make the script, you can use Python IDLE which was also installed.
For Windows:
- You need to install Python 3 from here
- Follow the setup instructions, making sure to check the box that says whether to add it to the system PATH variable
- Go into
cmd,cdto the location of the script, and typepython script.py, replacingscriptwith your filename or open the script with Python Launcher which will have been installed via the installer
To make the script, you can use Python IDLE which was also installed.
answered Jan 6 '15 at 11:15
ᔕᖺᘎᕊᔕᖺᘎᕊ
5,19842441
5,19842441
This link does not give Python 3, it gives an installer, .msi. Coming from the Mac, I am not fond of installing programs. Anyway, I have (re-)tried the installer, to no avail. Even when I choose to install "just for me", the installer asks me for admin auth, and it fails. Why can't those people just provide a Zip file ?
– Nicolas Barbulesco
Jan 6 '15 at 11:41
@NicolasBarbulesco So you want to run python without installing? Like a portable version??
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:43
Yes ! I am looking into @karel's solution.
– Nicolas Barbulesco
Jan 6 '15 at 11:45
1
OK, I didn't see @karel's comments - I agree about using Portable Python, it works fine on a USB for me :)
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:46
add a comment |
This link does not give Python 3, it gives an installer, .msi. Coming from the Mac, I am not fond of installing programs. Anyway, I have (re-)tried the installer, to no avail. Even when I choose to install "just for me", the installer asks me for admin auth, and it fails. Why can't those people just provide a Zip file ?
– Nicolas Barbulesco
Jan 6 '15 at 11:41
@NicolasBarbulesco So you want to run python without installing? Like a portable version??
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:43
Yes ! I am looking into @karel's solution.
– Nicolas Barbulesco
Jan 6 '15 at 11:45
1
OK, I didn't see @karel's comments - I agree about using Portable Python, it works fine on a USB for me :)
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:46
This link does not give Python 3, it gives an installer, .msi. Coming from the Mac, I am not fond of installing programs. Anyway, I have (re-)tried the installer, to no avail. Even when I choose to install "just for me", the installer asks me for admin auth, and it fails. Why can't those people just provide a Zip file ?
– Nicolas Barbulesco
Jan 6 '15 at 11:41
This link does not give Python 3, it gives an installer, .msi. Coming from the Mac, I am not fond of installing programs. Anyway, I have (re-)tried the installer, to no avail. Even when I choose to install "just for me", the installer asks me for admin auth, and it fails. Why can't those people just provide a Zip file ?
– Nicolas Barbulesco
Jan 6 '15 at 11:41
@NicolasBarbulesco So you want to run python without installing? Like a portable version??
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:43
@NicolasBarbulesco So you want to run python without installing? Like a portable version??
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:43
Yes ! I am looking into @karel's solution.
– Nicolas Barbulesco
Jan 6 '15 at 11:45
Yes ! I am looking into @karel's solution.
– Nicolas Barbulesco
Jan 6 '15 at 11:45
1
1
OK, I didn't see @karel's comments - I agree about using Portable Python, it works fine on a USB for me :)
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:46
OK, I didn't see @karel's comments - I agree about using Portable Python, it works fine on a USB for me :)
– ᔕᖺᘎᕊ
Jan 6 '15 at 11:46
add a comment |
There is a difference from Linux to Windows.
On Linux you would type like this:
python3 script.py
While on Windows (once you have Python installed) chances are you would type:
py -3 script.py
Comparing to py -2 script.py that would run Python 2.
Note: On Windows python or python.exe would call the latest version of Python you have installed.
1
Huh, aren't the Windows binaries calledpython.exe? Where did you getpyfrom?
– slhck
Jan 11 at 12:58
I don't care, I just use it withpywhen I need to specify the version, butpythonorpython.exestill works.
– prosti
Jan 11 at 15:48
So it's not really required. That said, this seems to be a new feature with version 3.6: docs.python.org/3/using/windows.html
– slhck
Jan 11 at 21:21
add a comment |
There is a difference from Linux to Windows.
On Linux you would type like this:
python3 script.py
While on Windows (once you have Python installed) chances are you would type:
py -3 script.py
Comparing to py -2 script.py that would run Python 2.
Note: On Windows python or python.exe would call the latest version of Python you have installed.
1
Huh, aren't the Windows binaries calledpython.exe? Where did you getpyfrom?
– slhck
Jan 11 at 12:58
I don't care, I just use it withpywhen I need to specify the version, butpythonorpython.exestill works.
– prosti
Jan 11 at 15:48
So it's not really required. That said, this seems to be a new feature with version 3.6: docs.python.org/3/using/windows.html
– slhck
Jan 11 at 21:21
add a comment |
There is a difference from Linux to Windows.
On Linux you would type like this:
python3 script.py
While on Windows (once you have Python installed) chances are you would type:
py -3 script.py
Comparing to py -2 script.py that would run Python 2.
Note: On Windows python or python.exe would call the latest version of Python you have installed.
There is a difference from Linux to Windows.
On Linux you would type like this:
python3 script.py
While on Windows (once you have Python installed) chances are you would type:
py -3 script.py
Comparing to py -2 script.py that would run Python 2.
Note: On Windows python or python.exe would call the latest version of Python you have installed.
edited Jan 11 at 15:51
answered Jan 11 at 12:29
prostiprosti
993
993
1
Huh, aren't the Windows binaries calledpython.exe? Where did you getpyfrom?
– slhck
Jan 11 at 12:58
I don't care, I just use it withpywhen I need to specify the version, butpythonorpython.exestill works.
– prosti
Jan 11 at 15:48
So it's not really required. That said, this seems to be a new feature with version 3.6: docs.python.org/3/using/windows.html
– slhck
Jan 11 at 21:21
add a comment |
1
Huh, aren't the Windows binaries calledpython.exe? Where did you getpyfrom?
– slhck
Jan 11 at 12:58
I don't care, I just use it withpywhen I need to specify the version, butpythonorpython.exestill works.
– prosti
Jan 11 at 15:48
So it's not really required. That said, this seems to be a new feature with version 3.6: docs.python.org/3/using/windows.html
– slhck
Jan 11 at 21:21
1
1
Huh, aren't the Windows binaries called
python.exe? Where did you get py from?– slhck
Jan 11 at 12:58
Huh, aren't the Windows binaries called
python.exe? Where did you get py from?– slhck
Jan 11 at 12:58
I don't care, I just use it with
py when I need to specify the version, but python or python.exe still works.– prosti
Jan 11 at 15:48
I don't care, I just use it with
py when I need to specify the version, but python or python.exe still works.– prosti
Jan 11 at 15:48
So it's not really required. That said, this seems to be a new feature with version 3.6: docs.python.org/3/using/windows.html
– slhck
Jan 11 at 21:21
So it's not really required. That said, this seems to be a new feature with version 3.6: docs.python.org/3/using/windows.html
– slhck
Jan 11 at 21:21
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2fsuperuser.com%2fquestions%2f861255%2fhow-can-i-run-a-python-3-script%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
1
Are you sure you do not have python3 installed on your linux box ? Several distros ship it but it is not the default python used to run scripts.
– NaeiKinDus
Jan 6 '15 at 11:02
@NaeiKinDus - No, I am not sure. I have tried the command
python3but the command is not found.– Nicolas Barbulesco
Jan 6 '15 at 11:10
1
you could try the following project for linux: code.google.com/p/pts-mini-gpl/wiki/StaticPython You can directly download the Python binary and run it without having to install it on your system.
– NaeiKinDus
Jan 6 '15 at 12:58
@NaeiKinDus - I have already managed to use the Portable Python suggested by Karel. But StaticPython is good to know.
– Nicolas Barbulesco
Jan 6 '15 at 13:09