hernanemartinez
hernanemartinez

Reputation: 727

How to install Python (any version) in Windows when you've no admin privileges?

The "NO ADMIN PRIVILEGES" part is key. I need to install Python but I do not have access to it in order to run the installation in a proper way. I'm also behind a firewall, so the "pip" option is quite limited.

Could you help me figure this out?

Upvotes: 70

Views: 207135

Answers (8)

VonC
VonC

Reputation: 1327484

With Windows 2010 edition May 2019, you won't have to execute a msi setup or download an Anaconda edition or go to the python website.

  • Windows has a python.exe and python3.exe already pre-installed
  • those commands will get you directly to the Microsoft Store!

Example: Python 3.9, which installs python and puts python on the path for the current user. So, no need for admin privileges.

There is a discussion about this on the Talk Python To ME podcast #191 with Steve Dower from Dec. 2018.

See more at "Who put Python in the Windows 10 May 2019 Update?" from the same Steve Dower (also on Stack Overflow):

This version of Python is fully maintained by the community, installs easily on Windows 10, and automatically makes common commands such as python, pip and idle available (as well as equivalents with version numbers python3 and python3.7, for all the commands, just like on Linux).

https://devblogs.microsoft.com/python/wp-content/uploads/sites/12/2019/05/Python_After-1024x449.png


Note: not2qubit adds in the comments that:

The MS Store python install is not recommended, as you will have no control of where things go, PATH's etc.
Unless you are a first timer of Python, do it manually from the MSI (or winget -i) installer and use the Customize installation option.

You may want to check py launcher option if you want to be able to click a py file to run.
This is also not standard way to run a python file, unless you're creating an entire app.
In addition, this check box will make all *.py files executed using the default python file opener py.exe, instead of an editor like (np++, VSCode, etc.), for example.

Upvotes: 2

AaronSinn
AaronSinn

Reputation: 98

Try installing off the Microsoft Store

Upvotes: -1

Ando G
Ando G

Reputation: 119

I would suggest you try using Anaconda. It can be installed to a local user folder without requiring admin permissions.

With this, you also get a quite nice package management conda.

Upvotes: 7

skvp
skvp

Reputation: 2000

I downloaded embeddable zip file from the site. Extracted it to the folder of my choice. Then added that folder in the windows path variable (using setx). It worked for me. Well this install only python and not the other packages like pip etc.

Later I found better and simpler way with Python 3.7.0 version for windows.

  1. Download windows installer exe.
  2. Run the exe.
  3. Screen will be shown to chose the installation option.
  4. Uncheck "install for all users" option.
  5. Go for the custom installation.
  6. On next screen specify the directory path for which your user have full access on the computer.
  7. Uncheck "create shortcuts for installed application" option.
  8. Make sure "Add python to environment variable" option is Unchecked .
  9. complete the installation.
  10. Add the installation and Script folder path in PATH using setx

This has installed all the default components of python

Upvotes: 37

Andy
Andy

Reputation: 50600

From the Python website, download the MSI version of Python you wish to install.

Then open your command prompt and use this command:

msiexec /a python-2.7.10.msi /qb TARGETDIR=C:\python27

Substitute python-2.7.10.msi, if you downloaded Python 3 and adjust your TARGETDIR to where you want it to go.

The /qb flag will give you a small dialog progress bar.

Upvotes: 71

Sebastian Wozny
Sebastian Wozny

Reputation: 17506

I suggest you use Anaconda (open source edition).

Anaconda is a completely free Python distribution (including for commercial use and redistribution). It includes more than 300 of the most popular Python packages for science, math, engineering, and data analysis.

One great feature of Anaconda is that it installs to your home folder, to which you should have write access.

It ships with a conda script that let's you install packages too.

Keep in mind that you will not be able to add it to the System PATH, though you can try to add it to your user PATH. If you can not add it to either, you will have to manually specify the full path to the python executable to run scripts from the command line.

Upvotes: 10

Adam Cox
Adam Cox

Reputation: 3681

As the comment states: "uncheck '[Install launcher] for all users'"..

enter image description here

Upvotes: 19

theB
theB

Reputation: 2238

Uncheck 'Install for all user' when the installation starts. Rest will be taken care by Python-3. I'm using Python-3.7.6 with this method.

This installation method will automatically updates current user's path for Python. But the application name will be py instead of python. The user has to handle environment variables if he wants to use pip or python commands.

Upvotes: 5

Related Questions