Who put Python in the Windows 10 May 2019 Update?

Steve Dower

Steve

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

The Windows command prompt showing an error when Python cannot be found 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.

The header of the Python 3.7 page in the Microsoft Store

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).

The Windows command prompt showing that "python3.7" now launches Python and "pip3" launches pip

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.

Scott Hanselman on Twitter: "WHOA. I'm on a new copy of Windows and I typed Python - on a machine where I don't have it - and it launched the Windows Store into an official distribution I can install in a click. WHEN did this happen. I love this." 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.

 

67 comments

Leave a comment

  • Avatar
    Niko Strijbol

    I know this is probably too much work for one release of Windows, so it’s a nice interim solution, but wouldn’t it make more sense to create a decent official package manager for Windows instead of having to include shims for who knows how many programs?

    • Steve Dower
      Steve DowerMicrosoft logo

      Yep, we’re definitely not going to get into the “let’s have hundreds of shims” game. But it was worth it for this one to see whether the workflow actually works.

      And the challenge with an official package manager is that someone needs to produce the official packages 🙂 The advantages are that we know that users aren’t going to be stuck with broken products or installs if they all go through the store, but of course it takes more effort for the package publishers. Getting one example out there should help us see which approach to take in the future.

      • Avatar
        Andrew Marlow

        I welcome this relatively new awareness and acceptable of python by Microsoft. IMO it’s a step in the right direction but sadly falls short of simple providing it by default. I had this argument with a Microsoft representative at QCON Lon in 2019. My argument was that there needs to be a decent portable scripting language. By default Windows doesn’t have one. He gave the reply “yes, but which language should we pick (there are so many to choose from)?”. Well, I think this move shows that the answer to that question is “python”.

        It’s interesting to note that making the python command available by default but by default “python” does not invoke the python interpreter seems to hurt people that require their systems to have python the most, judging by the comments below. I think these issues would just go away if the actual interpreter was installed by default, set up so it can be upgraded as and when via the Microsoft Store.

        Another reason to have python installed as default is for use in corporations. Many corporations disable access to the Windows Store so that makes python off-limits.

  • Avatar
    Jackson, Dan

    What about LTSC versions of Windows that don’t have the Microsoft Store? Should we just continue to use python.org or Visual Studio installers, or will there be a way to sideload this official version onto 1809 LTSC (for example)?

    • Steve Dower
      Steve DowerMicrosoft logo

      If the python.org installers are fine, I’d say keep using those (they are also the ones that the Visual Studio installer includes, so it doesn’t matter which of these you use).

      But if you have a use case for getting the MSIX file directly so you can sideload it, the best place to share it would be by filing a bug at https://bugs.python.org/ asking for them to be published as a separate download. They could be made available on python.org as their own download, but the need would have to outweigh the confusion when people download them by mistake and have to figure out what to do with it.

  • Avatar
    Shawn O. Eary

    I know I’m a bit odd, but I would personally rather see the Glasgow Haskell Compiler and Interpreter installed into MS Windows by default than something named after an ugly snake.  I’ve used Python before and honestly I don’t care for scripting languages that lend themselves to tons of runtime errors.  I tend to prefer more strict languages like F# and now Haskell for “automation” tasks.  While it’s disappointing that F# seems to have “failed to thrive”, I would be interested if Microsoft reattempted to create a *pure* Haskell.NET that wasn’t polluted by Microsoft’s attempt to appeal to the masses.
    DISCLAIMER: My comment does not represent the oppinions of any of my current or former employers.

    • Steve Dower
      Steve DowerMicrosoft logo

      For that many machines, you probably want to put your own Python install higher in PATH (at least higher than the WindowsApps folder, possibly even into the per-machine section if that makes more sense). The Python installer normally puts it high enough that this isn’t an issue.

      If the machines are being used interactively, uses can use the “Manage App Execution Aliases” page to disable the alias. Then your regular python.exe will be found even when it is later on PATH.

  • Avatar
    Lennart Borgman

    Could you please tell the version number of Windows 10 where this way to setup python is included? (I can’t see the “python.exe” in my path. And I have just checked Windows Update again. I have the latest update of Windows 10, the latest I can get right now, at least.)

    • Steve Dower
      Steve DowerMicrosoft logo

      It is part of version 1903, which started rolling out the same day this blog was posted. Apparently you should be able to get it by checking for updates, but it’s possible that you have some piece of hardware that isn’t compatible yet and so it’s being blocked. You’ll have to contact support for help with that, I’m afraid. It’s more than we can do via blog comments

  • Avatar
    Mayeul Cantan

    That’s an interesting and welcome development, I am curious to see it unfold.
    But please, do tell me that “Python” and “pip” launch Python3 and pip3 by default, respectively. Python2 is EOL at the end of the year, so if you really need to include it, that’s the one to postfix with a “2” 😉
    Archlinux does it right, in my opinion 🙂

    • Steve Dower
      Steve DowerMicrosoft logo

      What’s Python 2? 🤡

      Yes, we’re only recommending Python 3 releases from the core Python team, not any of the legacy ones. People who know they need old versions know how to get them, while this is targeted at people who aren’t quite sure where to begin and most of the online docs aren’t helping them.

    • Steve Dower
      Steve DowerMicrosoft logo

      When you install the Python workload, Visual Studio 2019 handles Python very well.

      Interoperating with other languages is up to the languages though, so you’d need to get in touch with those communities to ask about that. Visual Studio is really just an editor, not a runtime.

  • Avatar
    Jan Gazda

    Hi, this is exciting news!But I suspect something is missing (or am I missing something?) “every install of Windows will include python and python3 commands that take you directly to the Python store page.” I just did fresh installation of win10 with May update and executables are not in PATH or missing entirely 🙁

  • Avatar
    Morten242 .

    While I appreciate it a lot I’m seeing some problems actually using this thing from programs like cmake. Having the shim in path isn’t enough for it to be actually picked up and used, I need to manually specify the path to the actual installation. Just picking the shim ends up with an error about the system not being allowed to access the file.

  • Avatar
    Andrew Boyd

    permission problems running install from WindowsStore
    python -m pip install –upgrade pipCollecting pipDownloading https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl (1.4MB)100% |████████████████████████████████| 1.4MB 3.2MB/sInstalling collected packages: pipFound existing installation: pip 19.0.3Uninstalling pip-19.0.3:Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: ‘c:\\program files\\windowsapps\\pythonsoftwarefoundation.python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\\lib\\site-packages\\pip-19.0.3.dist-info\\entry_points.txt’Consider using the `–user` option or check the permissions.

    python –user andrewb -m pip install –upgrade pipunknown option –userusage: python [option] … [-c cmd | -m mod | file | -] [arg] …Try `python -h’ for more information.

  • Avatar
    Jeff Ratcliff

    Just successfully installed the May 2019 Windows Update but python, python3, and python3.7 are still unrecognized commands. Perhaps this added feature only applies to a prerelease insider build. It’s also an easy mistake to make if one is a developer and has altered the PATH for python sometime in the past before installing the update.

    • Steve Dower
      Steve DowerMicrosoft logo

      We deliver the commands through a store app (“App Installer”), and those update in a second background step via the Microsoft Store app (or you can go there and force it).

      In most cases, it’ll happen quickly enough that you won’t notice, but immediately after upgrading you might. Probably by now it’ll be there for you 🙂

  • Avatar
    Zhe Li

    I installed Python from the Microsoft Store shortly after a fresh installation of Windows 10, and found that python says MSVCP140.dll is missing. Obviously the store version does not check if VC++ 2015 redistributables are installed (while the python.org installer does). Something you should improve on.

      • Avatar
        abhishek_simhadri@outlook.com

        Hi Steve

        I purchased a Lenovo Flex laptop which has Windows 10s. I tried to install Python 3.7 and Ubuntu 18 from the Microsoft appstore. Both are not working. The same MSVCP140.dll issue (mentioned by Zhe above).

        Do I have to move from Windows 10S to the regular Windows 10? Is it not possible to setup a dev environment on Windows 10S?

    • Steve Dower
      Steve DowerMicrosoft logo

      Hi Karl. I saw this myself yesterday, and I believe Windows is having trouble replacing the existing shortcuts. I was able to work around it by opening “Manage App Execution Aliases” and disabling the existing python.exe and python3.exe items there before installing.

      This looks like a new OS bug, and we’re investigating. If you are able to confirm it works for you after disabling the shortcuts then that would be helpful.

  • Avatar
    biz1@jondart.name

    So I go to install Python 3.8 from the Microsoft Store, and first it asks me to login, and then it asks for my name and birthdate. WTF do you need this info for? I am going to python.org and install it. You need to straighten out your privacy policies.

  • Avatar
    Alcides Neto

    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.

  • Avatar
    K P

    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 much all courses recommend.

  • Avatar
    Owen Davies

    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?

  • Avatar
    Nurul Akter Towhid

    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.

  • Avatar
    Raúl Núñez de Arenas Coronado

    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 done, so no biggie…

    And of course, thanks a lot for preparing this package, I think it’s a step in the right direction, even if it doesn’t work for me.

    • Steve Dower
      Steve DowerMicrosoft logo

      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 particular package doesn’t work, feel free to report a bug against them and say that I sent you 😉 ).

  • Kyle B.
    Kyle B.

    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.

  • Avatar
    Cole Mickens

    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_ frustrated with a computer. This ENTIRE process, in Linux, was as simple as `nix-env -iA esphome`. Instead in Windows 10 it’s, install Python, fix PATH, install PIP, pip install esphome. Except no, even though that worked FINE last night for my user account on the same god damn machine, when he tries it he just gets the Microsoft Store over and over and over.

    Probably one of the worst features I’ve ever seen in an OS. And amazing that y’all had the guts to do it after the DISASTER that was shoving “wget” into PS.

  • Ruslan S
    Ruslan S

    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 Microsoft Store window I simply ignored it because I certainly didn’t open it and it’s not good UX to open random windows without any clear additional messaging. And simply showcasing again the limitations of the “modern” platform and how it’s painfully disconnected from the “rest” of the Windows. What we got is an even better way to confuse novices, much better than the CMD clearly stating that the computer doesn’t have python at all.

    I already had Python installed and working fine before this change, and then this Windows update came and broke everything python-related. I can see the value in the idea, but it should have been implemented entirely differently. This may be a hint that you get from the command line to run a command-line version of getting this software from Windows Store, because it’s a known name of a cmd line tool that you might install from Windows Store. The current approach with zero-byte exes, overriding anything I had with higher-priority PATH and doing NOTHING if used with parameters – is baffling.

    And that’s coming from an absolute fan of everything that Microsoft does! Thanks for continuing improvements to the crazy amount of software, but please be more mindful of not breaking things for all users, not just novice ones. As said by a lot of people here – how about an ‘apt-get’ for Windows already? Where did chocolatey go? NuGet, npm — anything? If Windows Store is to be the new package manager – I’m totally fine with it too, just make it fit for purpose, including the support for classic programs, command line tools, a CLI to install and upgrade, proper version management, etc. Wouldn’t it be great to have one place to go for everything, verified by the platform supporters themselves? I’d pay for that. And yeah maybe there’s even a place for a crazy set up with zero-byte exes, but they need to actually do a great job of messaging what’s happening, and not be at the friggin START of my PATH variable, please.