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

This is at least as bad a problem on Linux — I would argue worse since I've seen people break the system tools written in Python — and it's mostly due to Python being old enough to be both widespread and to have accumulated tons of easily-googled bad advice. The people who have problems with this almost always also have tons of similar problems with everything else because they've avoided learning enough system administration to work cleanly or troubleshoot problems effectively, and that's unfortunately cross-platform — they'll also do things like copy DLLs into Windows system folders, get annoyed that rpm/dpkg won't let them install the wrong version of an important library, etc.



I work in an rpm shop, and we've been exploring switching to python. Could you expand on or link to some of the rpm&pyhton issues you've run into?


The main thing is understanding that the system python installation should be left alone and you should install each app/project in a separate virtualenv / venv so their versions of Python & installed packages are isolated from the system and each other. This also tends to get rid of about 99% of the times where someone try "sudo <previous command>" before reading the error message.

These days I tend to recommend using https://pipenv.readthedocs.io/ or https://poetry.eustace.io/ which will automate creation of those virtual environments and provide a nice interface for managing versioned package installs (i.e. `pipenv install foobar` will record the exact version you installed, including SHA-256 hashes, for repeatable installs).

If you're in the Red Hat world, note also that they're making some big (and I think welcome) changes to isolate the Python they use from the version developers use, which will also allow tracking newer versions faster:

https://developers.redhat.com/blog/2018/11/27/what-no-python...


I was looking at venv, but I guess not fully looking through into deployment. Do you know if venv works with setup.py bdist_rpm or is there nothing standard linking the two concepts?


You should not mix bdist_rpm and venv; but you can build eggs or wheels with bdist_egg/bdist_whl and install these into venv.




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

Search: