Re:The Incredible Growth of Python
by yladiz on Thursday September 07, 2017 @02:27AM
(#15189531)
I think you're right, the biggest pain for a general developer for Python is determining which package manager to use. I'm thankfully insulated from it a bit due to using Docker for a lot of my development, but I hate the fact that Pip won't install to your home/project directory unless you coax it to (and sometimes still won't even if you give it all the proper environment variables), and I think virtual environments are not the solution (I shouldn't have to think about how to install a package or work on a project). Especially coming from Node-land, and before that Ruby-land, Python seemed like a wonderfully designed language but with terrible package managers. From what I remember Pip is going to change the default to install on the home directory sometime in the future, but it shouldn't have taken years of discussion to come to the conclusion that it's the right thing to do.
[ Parent
| on HN ]
Re:The Incredible Growth of Python
by thanksgiving on Thursday September 07, 2017 @04:00AM
(#15189895)
I like python3 -m venv myfolder; source myfolder/bin/activate;
It is the easiest way to use python3 because even fedora (one of the more bleeding edge) likely won't finish migrating 2 to 3 in current year.
Why do you not like venv? What could be done better?
I don't really like virtualenv because you have to activate it to do anything and deactivate it if you want to go to another project or work on something unrelated. I'd much rather it work by the project directory so I don't have to worry about the activation part (this is why Node's package manager, for all its issues, is great: you install in a local folder unless you explicitly supply the -g flag). At least I should be able to install packages to my home directory.
Re:The Incredible Growth of Python
by thanksgiving on Thursday September 07, 2017 @05:43AM
(#15190273)
Ah yes. Local by default would be nicer.
I still think that the "project" directory is best, but I'm glad that Pip is moving to local-by-default in any case. It won't take away from the necessity of virtualenv for cases of different dependency versions, e.g. Django 1.4 and 1.10, I think, unfortunately, but it's definitely better than global by default.
The problem is not for people like you who already decided, the problem is for beginners who aren't aware of some of the 'envs' and are looking for recommended practices.
I've moved to Anaconda and never looked back. Worst case you use pip within your Anaconda environment. Best and usual case everything just works.
Re:The Incredible Growth of Python
by mixmastamyk on Thursday September 07, 2017 @08:13PM
(#15196940)
pip install --user pkgname
Does that not work for you?The user flag doesn't always work correctly, but my main annoyance is that I shouldn't have to supply a flag to do this. It should be default.
Re:The Incredible Growth of Python
by mixmastamyk on Friday September 08, 2017 @03:18PM
(#15203188)
I agree, and they are working towards it. In the meantime, there are shell aliases. That's how I ask rm to confirm deletion as well.