Hacker News new | past | comments | ask | show | jobs | submit login

I would generally not see the need, except I spent an hour helping a friend set up a Python dev environment, and it was terrible. The problem wasn't that the env itself was hard to set up, the problem was that it was very hard to figure out which Python it would use, where the packages would go, how to prevent the other four Python versions installed from interfering with it, etc.

This looks pretty great, so I'm probably going to give it a shot. Then again, a script would use a specific/known Python version and create a virtualenv with would also work.

EDIT: Maybe I should write a script that downloads all the necessary files somewhere and creates a virtualenv with a given Python version, a la `curl https://www.whatever.com/setupvenv.py | bash`.




Honestly I don't understand the python community anymore wrt. their module system. It looked fine when I learned programming with python but the more I learned about it and what is possible the more I got irritated.

Pythons module system is in the end in my opinion fundamentally broken, and the python virtual env's are also in the end just a hack to somehow make it work. I think it's kinda sad that the hack to somehow make it work became the standard solution.


For the specific problem of easily setting up Python environments, you may wish to look into pipenv: https://pipenv.pypa.io/en/latest/


I would generally recommend poetry over pipenv.


Pipenv is a bit deprecated, Poetry is the current recommendation (and what I use).


Pipenv and poetry seems ok, but before those two (and wheel) we use conda and it covers our need.

And this is my top concern when introducing python to new team.

There still no 'single' way to do this.


The problem with conda is that it's what broke the machine I was talking about. Apparently it doesn't very much like when you use a package manager other than conda, and things break in subtle ways.


pipenv felt like it took forever to complete simple tasks. I briefly used it for a small project and quickly realized that it was a mistake. I now just use conda environment.yml and a requirements.txt, those two cover most bases I feel like.


Agree 100%


pyenv[0] is designed to automate what you had to do. You install it + the libs for your distro[1], type pyenv global $VERSION into your terminal, and don't think about it anymore. venvs are made from the current version, and work exactly as intended.

[0]: https://github.com/pyenv/pyenv

[1]: https://github.com/pyenv/pyenv/wiki/Common-build-problems


I'll try that, thanks. An additional complication was that virtualenv (the script) was bokred on that computer, but maybe pyenv would have helped.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: