4 ms·
> I don't think it's Python's fault. Well, there's a long legacy of half-baked solutions and kludges. And, especially, install instructions consistently sugges
by ben509 6y ago
> I don't think it's Python's fault.
Well, there's a long legacy of half-baked solutions and kludges. And, especially, install instructions consistently suggest you do the worst thing: install stuff using pip.
Everyone knows that's bad advice, because it always fails in mysterious ways, and there's no good way to roll everything back.
I recommend:
python3 -m pip install pipx # Don't rely on the pip3 bin.
pipx install jupyterlab
# Now jupyter has an independent virtualenv.
# To install dependencies:
pipx inject jupyterlab numpy
# Where is everything?
pipx list
venvs are in /Users/ben/.local/pipx/venvs
apps are exposed on your $PATH at /Users/ben/.local/bin
...
Once you've done that, never install anything directly with pip3 again. If you're working on a project, use pipx to install poetry / dephell / pipenv and use them to manage the virtualenv.
And you can get rid of it all:
pipx uninstall-all
python3 -m pip uninstall pipx
- ImaCake 6y agoI use conda to do effectively the same thing. If my conda environment breaks and I can't roll it back, at least I can destroy it and start again. As an aside; it is really hard to explain why you should use anything but pip3 to people who only rarely need to interact with python.
- ben509 6y agoConda is pretty nice, and unless someone needs pypi, that's fair advice. And I agree, it's hard to explain not using pip3, so I just wouldn't. "For the best experience, pipx install neato-commando." And maybe link to the pipx website, in case someone actually clicks a link.
- xapata 6y agoConda works fine with Pip/PyPI.
- atg_abhishek 6y agoYup this is a good way to go around it, similar to another comment below, I use conda to manage all the stuff
- neumann 6y agoThank you! I've been using virtualenv+pip, conda+pip and a few other virtualenv wrappers lately, and never heard of pipx!
- mikecoles 6y agoInteresting coincidence: I'm currently side-watching a Youtube video about poetry. The video discusses python packaging in general. You have to skip through several minutes of pre-roll though. https://www.youtube.com/watch?v=tNlurLxcf68&feature=emb_logo https://www.youtube.com/watch?v=tNlurLxcf68&feature=emb_logo
- specialist 6y agoAs someone who has done driveby python work, how would I even know how to do that? Noob me found all sorts of howtos and getting started guides. Seemingly contradictory, mutual exclusive. My (extended) team couldn't even get all the Pythonistas to agree on The One True Python Stack™.
- disgruntledphd2 6y agoYou don't. It's a total nightmare for newbies. I ended up putting off learning Python for years as this kind of stuff kept happening (first the 2/3 transition, and then massive pip breakage).
- ben509 6y agoFollowing Python and Java is always informative because, between them, they manage to make almost every mistake imaginable, despite having very smart people putting careful thought into the design. Looking at the amount of polish on the Python docs and the fact that people still don't know how to install Python, it gives you a sense of how hard explaining things is. Maybe the Python site could do with an official "managing Python for end-users." > Noob me found all sorts of howtos and getting started guides. Seemingly contradictory, mutual exclusive. Python's a victim of its own success as the signal to noise ratio in online tutorials is very low; worse, the good management tools are relatively new. Even for smaller audiences, obsolescence is a big problem. The most painful aspect of working with LaTeX was I'd struggle with one buggy package recommended by a tutorial for ages, then search for "why am I getting this error" and find the answer was, "oh, yeah, that's horribly broken, use this one instead." [1]: https://www.python.org/doc/sunset-python-2/ https://www.python.org/doc/sunset-python-2/ [2]: https://www.python.org/doc/versions/ https://www.python.org/doc/versions/