r/Python • • Apr 30 '18

xkcd: Python Environment

Post image
2.4k Upvotes

388 comments sorted by

View all comments

36

u/lykwydchykyn Apr 30 '18

Not to start a platform war, but I feel like this is a distinctly macOS problem. I was recently testing sample code for a book that used Python 3.6, Tkinter 8.6, and cx_Freeze. Making that combination work on macOS takes stupid amounts of hacking.

Windows was somewhat less painful, and Linux worked fine with this stack using only repo packages and pip.

9

u/TBSchemer Apr 30 '18

I've been spending weeks worth of evenings trying to get my development environment set up on Windows.

All I want is to be able to have multiple versions of python installed, have pip, have virtual environments, and have a personal scripts folder in the path. This has been hell to set up.

  • virtualenvwrapper's Windows ports are buggy and broken.

  • Getting Windows to choose the right Python version is a pain in the ass, and most online suggestions are amateurish or just plain wrong (e.g. "just switch the order of PATH every time you want to use a different version!").

  • I was able to get the version to be selected properly by a script shebang using Python Launcher For Windows.

  • But this was only after I manually edited the registry so that PLFW could actually find my installed Python binaries.

  • I also had to manually set all file associations because the Python installer doesn't do it, even while claiming to.

  • PLFW can't find my scripts, even if they're in both the PATH and the PYTHONPATH.

  • I'm going to try to do virtual environments with venv, but as far as I can tell, there's no convenient wrapper for it like virtualenvwrapper. I guess I'll have to write my own.

  • I'm really uncertain about how well venv and PLFW will work together.

Windows is really a clusterfuck when it comes to setting up a development environment.

1

u/meandertothehorizon It works on my machine May 01 '18

Im sorry man, but you’re doing it wrong. Install python, install install virtualenv (if you are using py2). Create virtualenv, run activate.bat - and you are set. Run activate.bat in another virtualenv to activate it - or if you’re wanting to be at the “default” use ‘deactivate’. I have never had a problem using this on any platform -Windows, Mac, or Linux.

1

u/TBSchemer May 01 '18

The entire point is that I want to use multiple python versions.

Also, virtualenvwrapper.

0

u/meandertothehorizon It works on my machine May 01 '18

I’m not sure what the problem is with using multiple python versions. You can have any number of virtualenvs and each one is independent from the other.

1

u/TBSchemer May 01 '18

See my list of issues above.

0

u/meandertothehorizon It works on my machine May 01 '18

Sorry, the tools are there, I’m impressed at your ability to over complicate this. You come bitching, and snarky - so.. enjoy your misery? Not sure what you want here.

→ More replies (4)