6 ms·
The current paradigm feels OK to me. Unfortunately there are a lot of old crappy "intro to Python" blog posts and tutorials still telling people to use 'sudo pi
by ddavis 6y ago
The current paradigm feels OK to me. Unfortunately there are a lot of old crappy "intro to Python" blog posts and tutorials still telling people to use 'sudo pip install' to install packages on their system Python. pip/setuptools do not support that workflow. I think it's slowly getting more widely recognized.
- dheera 6y agoIt seems to me like Python 3.8 has broken a LOT of stuff, violating semantic versioning. Like, for example, RealSense cameras don't work anymore.
- nuclear_eclipse 6y agoPython has never used semantic versioning. There is a long history of small, breaking changes between "minor" releases of Python. Eg, Python 3.7 made `async` and `await` global keywords, breaking any case where old code used `async` as a variable name.
- eesmith 6y agoIf I understand https://github.com/IntelRealSense/librealsense/issues/6296 https://github.com/IntelRealSense/librealsense/issues/6296 and https://github.com/IntelRealSense/librealsense/issues/5777#issuecomment-582480988 https://github.com/IntelRealSense/librealsense/issues/5777#i... correctly, what happened is the RealSense developers don't provide a pre-compiled version for 3.8 on PyPI. Python is "broken" in that the C API does not maintain backwards compatibility. (See https://www.python.org/dev/peps/pep-0620/#the-c-api-blocks-cpython-evolutions https://www.python.org/dev/peps/pep-0620/#the-c-api-blocks-c... for a proposed solution.) RealSense is "broken" in that they don't provide builds for all the versions of Python their users use. But that's because "Officially, Librealsense is only currently supported up to Ubuntu 18.04 LTS" Perhaps also your process is "broken" for depending only on pre-compiled builds; the published solution is to build from source. https://github.com/IntelRealSense/librealsense/issues/6296#issuecomment-644291191 https://github.com/IntelRealSense/librealsense/issues/6296#i... says it's possible. Or "broken" for using an unsupported environment and expecting it will work. Software in general is broken. It's amazing that it works as well as it does.
- dheera 6y ago> the published solution is to build from source I tried that, it didn't work, and they keep closing issues about it instead of addressing it. They are a company with a 200B market cap, and it's already 5 months since the release of 20.04 and they still can't get their drivers straight. People like me want to use their hardware. I don't have time to be debugging their drivers -- I have other work to do. I don't think it's unreasonable ask for them to support the latest LTS release of the most common Linux distribution in a timely manner with pre-compiled binaries that just work, in return for the $179 that I and tens of thousands of others paid for the device. This isn't some open source community software that I'd be glad to pitch in some time and help debug. This is a driver for a device that I paid a for-profit company for and I expect timely support especially for an exceedingly common OS that I use.
- eesmith 6y agoYou wrote "Python 3.8 has broken a LOT of stuff", as if it were only Python's problem. Clearly other things are broken too.
- dheera 6y agoIf they maintained semantics of versioning, any 3.x code should always run on 3.(x+1)
- eesmith 6y agoSure. But they don't. So is the error in them, for not following semantic versioning, or is the error in you for incorrectly assuming they follow semantic versioning? Are you really just complaining about the version numbering? Ok, let's say they follow semantic versioning, and instead of calling it 3.8 they called it 4.0. The package you use would still be broken. Now what do you do? Why don't you install Python 3.7 yourself and pip install the pre-built binary?
- neckardt 6y agoI'm one of those people using 'sudo pip install'. What should I be using instead?
- CapriciousCptl 6y agoPython -m venv in your project directory. Then source ./bin/activate. Pip install from the project directory as your regular user (no sudo). You can also set up venv (virtual environments) in home or somewhere else instead of for each project. This is called python virtual environments and very easy to adopt.
- ydnaclementine 6y agoRuby has this figured out well by comparison. Install the bundler gem (which you're going to be installing anyway to get dependencies), cd into the project, and prefix your commands with `bundle exec` to use project gems Remembering to start/stop virtualenv and remembering the names of your virtual envs is one too many steps
- easton 6y agoOr just use poetry/pipenv shell (or poetry/pipenv run for one-off commands). Both provide a good wrapper, although poetry seems a bit more stable these days.
- thewrinklyninja 6y agoPerl has copied this as well with Carton. Works really well and as standard keeps the modules in the project dir. https://metacpan.org/pod/Carton https://metacpan.org/pod/Carton
- viraptor 6y agoIf you prefer "bundle exec foo", then "bin/python -mfoo" is pretty much the equivalent and doesn't require running activate before.
- kevin_thibedeau 6y ago