Could someone ELI7 why python is struggling so hard with dependencies and dependency management when in the Java world this is a solved problem and just works with maven, which is working so damn well it last got updated in November 2019, and the biggest fight going is whether you should use gradle as client instead of maven to access the same dependency ecosystem? I had to set up Python projects for some machine lea…
Java is a self hosted language and has very little dependency on C/C++ or something similar. Python is glue language for C/C++/Fortran/Rust/etc. projects. Most of the valuable packages in Python in fact C++ projects (like Tensorflow, Pandas, etc.). When you are talking about Python dependency management you are talking about the Cartesian product of the packages you are depending on, their dependency in terms of comp…
You don't really need a virtualenv
51–60 of 148 posts
Re: You don't really need a virtualenv
#52Earlier quoted context omitted.
Python should just do what JavaScript does and install all dependencies to a project-local folder.
Not sure if JavaScript has anything that any other language or development tool should copy.
Re: You don't really need a virtualenv
#53Re: You don't really need a virtualenv
#54> things get tricky when it comes to nested venvs Never had such a requirement. Environments, like the interpreter itself, seem a singleton concept. I have used a Makefile that sources different Bash environment variables kept in files in etc/ within the venv to switch between, say, a Flask and a Gunicorn startup.
Way way harder on yourself.
Re: You don't really need a virtualenv
#55Could someone ELI7 why python is struggling so hard with dependencies and dependency management when in the Java world this is a solved problem and just works with maven, which is working so damn well it last got updated in November 2019, and the biggest fight going is whether you should use gradle as client instead of maven to access the same dependency ecosystem? I had to set up Python projects for some machine lea…
Re: You don't really need a virtualenv
#56This was a good article and looks like an interesting project. Regardless of whether or not you choose to _deploy_ with Docker, _developing_ in Docker containers using the VS Code Remote extensions really solved all of Python's (and Javascript's) annoying packaging problems for me, with the bonus that you also get to specify any additional (non-Python) dependencies right there in the repo Dockerfile and have the deve…
I just read this https://ntietz.com/tech-blog/drawbacks-of-developing-in-cont... The author highlights some of the problems of using docker in development.
I probably should have been more careful to qualify my enthusiasm above. I’m definitely not suggesting that everyone that has a Python packaging problem should go out and solve it with Docker. As with all things, there are trade-offs and you should satisfy yourself that Docker is the right tool for your particular problem before diving in.
I just wanted to highlight the fact that - as a VS Code user who has some experience with Docker and writes in a couple different languages and ecosystems - I’ve had a great experience with this modality and find that overall it simplifies my workflow.
Re: You don't really need a virtualenv
#57Earlier quoted context omitted.
Python should just do what JavaScript does and install all dependencies to a project-local folder.
Not sure if JavaScript has anything that any other language or development tool should copy.
- There's one tool to use, and it comes pre-installed
- You don't have to deal with virtualenvs or packages from different projects conflicting.
- Native code dependencies "just work".
Re: You don't really need a virtualenv
#58Earlier quoted context omitted.
I have the opinion that this is because "Deployment" is not a solved issue (or clearly defined and enforced) for Python. C has shared libraries and static compilation (bundling of dependencies) Java has .jar files which probably contain all your dependencies, go and Rust statically compile to something that has minimal dependencies and python has... no clue. Some packages you have to install via your package manager…
Python should just do what JavaScript does and install all dependencies to a project-local folder.
Re: You don't really need a virtualenv
#59Could someone ELI7 why python is struggling so hard with dependencies and dependency management when in the Java world this is a solved problem and just works with maven, which is working so damn well it last got updated in November 2019, and the biggest fight going is whether you should use gradle as client instead of maven to access the same dependency ecosystem? I had to set up Python projects for some machine lea…
Java is a self hosted language and has very little dependency on C/C++ or something similar. Python is glue language for C/C++/Fortran/Rust/etc. projects. Most of the valuable packages in Python in fact C++ projects (like Tensorflow, Pandas, etc.). When you are talking about Python dependency management you are talking about the Cartesian product of the packages you are depending on, their dependency in terms of comp…
They would be if python provided the .h files in the packages rather than expecting them to already exist on the system.
Re: You don't really need a virtualenv
#60Earlier quoted context omitted.
He also said virtual envs install their own copy of Python. No need for that either. Coming from other languages the whole virtual env thing seems alien especially the way it messes with your shell.
A virtualenv (venv) does not install its own copy of Python. Instead, when you create the venv it puts symlinks for the calling python in the /bin directory. When you activate the venv the /bin is added to the front of your PATH so that any "python" commands use the symlink'ed version of Python corresponding to your venv.