Today the Windows team announced the May 2019 Update for Windows 10. In this post we’re going to look at what we, Microsoft’s Python team, have done to make Python easier to install on Windows by helping the community publish to the Microsoft Store and, in collaboration with Windows, adding a default “python.exe” command to help find it. You may have already heard about these on the Python Bytes podcast, at PyCon US, or through Twitter.
As software moves from the PC to the cloud, the browser, and the Internet of Things, development workflows are changing. While Visual Studio remains a great starting point for any workload on Windows, many developers now prefer to acquire tools individually and on-demand.
For other operating systems, the platform-endorsed package manager is the traditional place to find individual tools that have been customized, reviewed, and tested for your system. On Windows we are exploring ways to provide a similar experience for developers without impacting non-developer users or infringing publishers’ ability to manage their own releases. The Windows Subsystem for Linux is one approach, offering developers consistency between their build and deployment environments. But there are other developer tools that also matter.
One such tool is Python. Microsoft has been involved with the Python community for over twelve years, and currently employ four of the key contributors to the language and primary runtime. The growth of Python has been incredible, as it finds homes among data scientists, web developers, system administrators, and students, and roughly half of this work is already happening on Windows. And yet, Python developers on Windows find themselves facing more friction than on other platforms.
Installing Python on Windows
It’s been widely known for many years that Windows is the only mainstream operating system that does not include a Python interpreter out of the box. For many users who are never going to need it, this helps reduce the size and improve the security of the operating system. But for those of us who do need it, Python’s absence has been keenly felt.
Once you discover that you need to get Python, you are quickly faced with many choices. Will you download an installer from python.org? Or perhaps a distribution such as Anaconda? The Visual Studio installer is also an option. And which version? How will you access it after it’s been installed? You quickly find more answers than you need, and depending on your situation, any of them might be correct.
We spent time figuring out why someone would hit the error above and what help they need. If you’re already a Python expert with complex needs, you probably know how to install and use it. It’s much more likely that someone will hit this problem the first time they are trying to use Python. Many of the teachers we spoke to confirmed this hypothesis – students encounter this far more often than experienced developers.
So we made things easier.
First, we helped the community release their distribution of Python to the Microsoft Store. 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).
Finally, with the May 2019 Windows Update, we are completing the picture. While Python continues to remain completely independent from the operating system, every install of Windows will include python
and python3
commands that take you directly to the Python store page. We believe that the Microsoft Store package is perfect for users starting out with Python, and given our experience with and participation in the Python community we are pleased to endorse it as the default choice.
We hope everyone will be as excited as Scott Hanselman was when he discovered it. Over time, we plan to extend similar integration to other developer tools and reduce the getting started friction. We’d love to hear your thoughts, and suggestions, so feel free to post comments here or use the Windows Feedback app.
This was poorly planned out. Could you undo this please? I'm a professional developer (just not a Python one) and struggled for good 15 minutes until I googled the right thing to understand why my python commands do ABSOLUTELY NOTHING. No message, no nothing. They don't even open the Windows Store - they do that only when you supply zero parameters to python.exe - and why would I try that? When it did open the...
This is great, really great. /s I've spent over an hour trying to get Python3 working on my dad's machine. The installer completes, even with "Add to PATH" selected. I can see it in his environment variables. And yet, no matter what, when he types python3, the fucking Microsoft Store opens.
I'm appalled that this feature shipped and amazed that someone would publicly claim credit for it. I can't remember the last time I was _this_...
The VERY LEAST you could do is put up a page with clear instructions on how to unfuck our machines so we can actually do real work on them. Instead I’m having to look in lots of random places to find out what manual PATH manipulation I need to do to get my machine back to the way it should just be.
Hi Cole, sorry you ran into issues. The installer from python.org does not (and never has) created a python3.exe command - it's only ever been python.exe. However, if you install from the Store, your PATH will be configured with python, python3, python3.8 and equivalent pip and IDLE commands.
The clear instructions are at https://docs.microsoft.com/en-us/windows/python/faqs#why-does-running-pythonexe-open-the-microsoft-store
We're getting the lack of explanatory messages fixed, and getting the CPython devs to update their Store page to help explain the situation...
This is extremely annoying behavior because it’s not integrated with any custom installations of python (including installations from VS 2019) and requires manipulations with Path variable to fix it.
Hi, I created an account just to say that this was a terrible idea. It was difficult to find and track down this issue and to find that some “feature” is causing it is ridiculous. Before you deploy a change that will certainly break your average development environment, how about thinking or testing!? Completely absurd it hooks far too low, before it can even find programs that have been installed for years. Terrible.
Unfortunately, this package (I mean the latest one at the time of this writing, version 3.8) doesn't add "Scripts" to the PATH environment variable, so it's impossible to properly install pip packages like pylint.
I suppose that's one of the many reasons it has so many one-stars reviews in the Microsoft Store.
Any chance of this being fixed or am I stuck to installing it by hand? Which BTW is not a problem, it's what i've always...
Unfortunately, Windows Store apps are not allowed to modify system settings like PATH, so right now it's not possible. In the future, we might get a way to generate lightweight apps when installing packages, which might make it possible to add global aliases.
For now, the best thing to do is use the "-m" option. Most packages (including pylint) can be run with "python3 -m pylint ..." without having to modify PATH at all (if a...
This is one of the worst situations for regular python users like me who is using conda. I mostly use Jupyter Notebook when I need to run any py file using “python code.py” was ok. Now it’s not working. Thank you for your update without any real user feedback.
What is the solution for those of us using Windows on isolated networks? I have a machine that will never be allowed to be connected to the internet so a link to the Microsoft store won’t do anything. How do we get the package that would be installed by using the store links in a form we can bring in to the isolated network and install offline?
Check out https://docs.microsoft.com/en-us/microsoft-store/distribute-offline-apps for your options here.
Or alternatively, continue downloading from http://www.python.org and copying it yourself. That installer is not going away, and it’s identical to what’s in the Store (both packages are published by the Python community – not Microsoft).
Steve – you’re an absolute moron if you think this was a good idea.
I fixed this problem today by moving the Windows apps environmental variable in Windows to the very bottom, uninstalling VSCode, reinstalling Anaconda and selecting the option to add Anaconda to the path. Now I can type path and get the Anaconda python to come up. I'm going to install VSCode but only through Anaconda. The Microsoft store stuff is making it overly complicated, just get rid of it and let people use Anaconda which pretty...
Not a perfect fix, but I took to launching Powershell from the Anaconda Navigator.
Python from within there elicits the >>> prompt as expected.
Great idea, now you fucked up my Anaconda install and I cannot fix the “import numpy” problem. I did everything to resolve, it but nothing works! Thank you so much M$ I will try some distro like Mint to work with python. You screw up again.