pyenv / pyenv

Simple Python version management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows support

mcandre opened this issue ยท comments

Could we port pyenv to Windows?

I imagine .bat scripts could mimic the behavior of the .sh scripts.


A note from the pyenv maintainers:

pyenv does not currently support Windows outside of the Windows Subsystem for Linux (WSL). We have no current plans to support Windows in the future.

@kirankotari has helpfully provided a port of pyenv for windows called pyenv-win, which hopefully will meet the needs of windows users.

I'm no longer using Windows. I don't like to waste my time with such thing.

Windows isn't my favorite development platform either, but it's nice to be compatible for their benefit. There are development tools that aren't Unix compatible, and it's annoying to have to go back and forth between them. You end up with a build system that needs multiple operating systems just to build the application.

As someone who is just in need of running Python but am clueless as how things are done in it, this StackOverflow answer makes it seem like it's now simple to have support for multiple pythons in Windows. I don't know if it's true but maybe this helps someone in my situation.

How granular does the Python Launcher support version numbers? Would #!python2.6.0 work, or just #!python2?

Can the Python Launcher parse the version in #!/usr/bin/env python[version] shebangs popular in Unix? It would stink to have to constantly change the shebangs back and forth between Unix and Windows.

@mcandre fuck if I know. Python seems as easy to deploy on Windows as ksh scripts. Actually, one option is to port Python code to Objective-C to make it easier to deploy on Windows!

I'm no longer using Windows. I don't like to waste my time with such thing.

Seems short-sighted to me, if you care about pyenv spreading. A lot of us work in places where we have to spend some of our time in Windows, and I'm more likely to prefer a tool I can use across environments than one that only runs in some of them.

I'm not a fan of Windows either, but the availability of things like virtualenvwrapper across environments has made it much easier for me to justify using them.

I also do not use Windows but users of my open-source projects do, so it would be great to have support for pyenv on Windows. I would use it together to AppVeyor to test my software on Windows without having Windows

As others have commented: Windows development may not be awesome, but a lot of us do use Windows for work because we have to (and some people just love it). I understand that you don't want to spend the time on it yourself, of course. Assuming someone could write Windows-friendly scripting, though, would you potentially accept PRs for it?

you can try pywin[https://github.com/davidmarble/pywin]

Also anyenv might be an option: https://github.com/mislav/anyenv, assuming that Go on Windows works well.
Anyenv is supposed to be the successor of rbenv, pyenv etc.

I'm interested in getting this working on Windows in my spare time. A couple of things I wouldn't mind feedback on though:

  1. pyenv install works by compiling python from source. Building python on Windows isn't actually too hard (I just built Python 3.6 with no issues). But getting a comprehensive set of build tools installed looks like a pain. To build all versions of python 2.x.x and 3.x.x you need VC++ 9.0, 10.0 and 14.0 and they all have their own fairly convoluted installation steps. So, perhaps an easier method would just be to download the official Windows builds. Is anyone heavily relying on adding custom build flags/patches etc. to their interpreter?

  2. Given how many bash scripts have been written, the easiest approach would probably be to patch pyenv so that it works in MSYS bash on Windows. I think this would still be useful, given that once an environment has been created it is relatively self-contained. Anyone see any obvious problems with this approach?

@edbordin
Maybe it is easier to look into https://github.com/mislav/anyenv for this? It has not been updated in a while, but was meant to replace rbenv/pyenv etc.

@blueyed Yeah, I wasn't too sure about that project because (a) it seems inactive, and (b) it doesn't seem to implement the pyenv install command at all atm...

@yyuu i have a mac and windows machine and I would like to know how to run this on Windows since I use both for testing so that sorta comment s gonna get a lot of dislikes even on GitHub

Came here to see if this ticket has possibly changed or had an update to it. Of course, I'm disappointed to not see it, but the tone in this thread is totally wrong.

The griping and down-thumbing you're doing here has been enough to drive other maintainers away from other projects. This vast majority of this project has been done by 5 people. And they've likely done so to solve their own particular problem, and now we all are benefiting from them doing the extra work of sharing it--this is not a light task.

I doubt any of them get paid to do this, and even if they are, they're not getting paid by you all. Just being a user doesn't entitle you to features much less one as huge as this.

So thanks maintainers! We really appreciate all that you do on this project for the community.

@raiderrobert Most of the down-thumbing was on the original response to the feature request which quite frankly had an arrogant and dismissive tone. Of course the maintainers owe nothing to anybody, but if you address people in that manner you cannot reasonably expect zero backlash. Being generous doesn't give you unlimited license to be a jerk to everybody.

To me, the majority of the responses here have just been constructive feedback on why people would find this feature useful. Whether it is feasible given how much time the devs have is a totally different story - perhaps making that point would have a been a better way to close the issue.

Having said all that, I'd also like to thank the maintainers for a really useful tool.

If you're still trying to find out how to get pyenv running on Windows, you might want to read up a little about the Windows Subsystem for Linux

the Windows Subsystem for Linux

Nope.

Unfortunately it looks like automatic switching of virtual environments offered by pyenv-virtualenv plugin is simply not possible with windows cmd :(

https://superuser.com/questions/933527/windows-run-script-on-cd

work fine in WSL on Windows 10. So, I kinda agree, nothing to do here.

It didn't work on wsl for me @cicorias. How did you install it?

Iโ€™ve been using Wlinux from the App Store. What distribution are you using and what errors? There probably missing packages that wlinux adds.

On the inspiration of this thread I have ported pyenv for windows which contains basic features of pyenv.

Link: pyenv-win

I want to thanks following people in the thread. Who made me, to took a decision on porting for windows.
@mcandre @ftomassetti @chriskrycho @edbordin @raiderrobert

@yyuu why would you close the issue? Even if you don't use Windows, a lot of the users of pyenv do. I do. Anybody else in the GitHub community could have contributed a PR with Windows support.

Please consider your users a bit more in the future.

And thank you @kirankotari for your port!

Even if you don't use Windows, a lot of the users of pyenv do.

True, but I don't own, use, or have access to Windows PCs, and I think this is likely true of the other maintainers. rbenv and nodenv also lack Windows support outside WSL and have expressed resistance to add support as well.

Anybody else in the GitHub community could have contributed a PR with Windows support.

Absolutely, which is why we have pyenv-win now. Thanks to @kirankotari for that amazing contribution to the community ๐Ÿ˜„

Please consider your users a bit more in the future.

The earlier comments by @raiderrobert and @edbordin are spot on. I agree that the original reply to this issue was rude, but we aren't obligated to support windows just because people ask. I know that's disappointing for all of you windows users, but we just can't support it at this time.

I'll add a section to the top comment with a link to pyenv-win and this comment so that the status on windows support is more clear and visible in the future.

Once pyenv-win is considered to be working well for many people it may be worth a mention in the readme even? But I do wonder how much there really is to share between the two what with them both trying to use native scripting languages which makes them inherently separate code even if they were to do similar things. I suppose maybe a lot of cli-level testing could be shared and would encourage them to retain similar interfaces?

it may be worth a mention in the readme even?

Sure, I just added a note ๐Ÿ‘

The idea for a shared "interface compatibility test suite" is great, I'm always in favor of more testing, I just don't have the time for that currently.

@flying-sausages the main reason I couldn't use WSL for python was the lack of CUDA support, so having a native Windows option is great! On my current project I've giving Anaconda a try since they allow you to specify the interpreter version on all platforms and they also make things like numpy+mkl easier on Windows. The conda environment.yml doesn't quite have as many of the features I'd like compared to Pipenv+pyenv though (particularly, no lock files), so this new pyenv-win project is still nice to have as an option ๐Ÿ˜

thanks guys for the support. @altendky thanks for bringing the point. My initial intention is to fork the pyevn itself to support windows, I love the pyenvs' the way today they are, but the differences I have encountered were massive changes which I am listing below. Help me to support as more features from pyenv to pyenv-win for windows, including testing.

  • Installation:- unlike linux and mac, we does not have zip/tar file for installation
  • Installation in background:- we does not have fully background installation for windows, trying a lot but due to policy of authentication minimum UI access is required. I have seen in most of the company laptops have this policy of authentication before installing. I am coming up with new ways to support complete background options for those doesn't have authentication policies i.e. personal laptops.
  • pip install support:- there was a slight difference on packaging to support via pip install, that's the reason you will see slight difference in packaging of pyenv and pyenv-win

Lot more feature yet to come. I have listed the new feature at pyenv-win/projects feel free to support or add more feature expectations in pyenv-win we will try our best to support them.

Thanks @kirankotari and others who contributed to the pyenv-win project.

I just change developing work from Mac to Windows so I really need tools like this. I use it with virtualenv and this combination can handle many basic use of developing work. Thanks again!

@flying-sausages the main reason I couldn't use WSL for python was the lack of CUDA support, so having a native Windows option is great! On my current project I've giving Anaconda a try since they allow you to specify the interpreter version on all platforms and they also make things like numpy+mkl easier on Windows. The conda environment.yml doesn't quite have as many of the features I'd like compared to Pipenv+pyenv though (particularly, no lock files), so this new pyenv-win project is still nice to have as an option ๐Ÿ˜

@edbordin CUDA support is coming up in WSL2 as per the latest announcement