Live data from Hacker News

Use `Python -m Pip`

snarky.ca

11–20 of 141 posts

Re: Use `Python -m Pip`

#12

This is great advice. To tack on: Python has had built-in virtualenv support since 3.3[1], meaning that you can do this: python -m venv env/ ...on any version of Python released in the last decade and get a reasonable virtual environment. To go one step further, you can also have `venv` automatically bring `pip` and `setuptools` to their latest versions: python -m venv --upgrade-deps env/ ...which you should almost a…

Yeah, I strongly advise ALWAYS using a virtualenv for any Python project. It's pretty much always a good idea.

Re: Use `Python -m Pip`

#13

Pyenv[1] solves the multiple versions of python problem in my experience. You can install the version of python you want and then can set that version globally, per directory, and then use that versions pip or take it further and use a virtualenv/poetry shell. 1: https://github.com/pyenv/pyenv

Not to be confused with pipenv!

Re: Use `Python -m Pip`

#15

Python is a fun language but the ecosystem around it is horrible. It's a shame. I just want to pip install like I would a package manager

I think you mean the package management rather than the ecosystem. For all its failings, the python ecosystem (for machine learning / data science in particular) is unmatched, which is why python is so popular.

As a "professional" python user (who got there in a roundabout way), I'd say the biggest problem with package management is all the conflicting advice and different ways to accomplish the same thing (there are other problems, but they are surmountable). Once you get a workflow down, it ends up being pretty easy to set up and manage an environment for a given project. Not that it's perfect, but I think a lot of the stereotypes about how bad it is come from how bad it appears as you try to converge on a setup that works for you.

Re: Use `Python -m Pip`

#18

Python is a fun language but the ecosystem around it is horrible. It's a shame. I just want to pip install like I would a package manager

I think you mean the package management rather than the ecosystem. For all its failings, the python ecosystem (for machine learning / data science in particular) is unmatched, which is why python is so popular. As a "professional" python user (who got there in a roundabout way), I'd say the biggest problem with package management is all the conflicting advice and different ways to accomplish the same thing (there are…

I remember when Perl was more popular generally than Python (late 90's and early 00's), and Perl espoused the mantra of (There is more than one way to do it: TIMTOWTDI).

As a tongue-in-cheek reaction, Python espoused "TOOWTDI", or There's Only One Way To Do It :)

reference: https://wiki.python.org/moin/TOOWTDI

The problem is, when it comes to the Python package management ecosystem, there are SO MANY ways to do it. And they aren't equal and require a deep understanding of each tool to select the correct choice.

It is a problem for Python, although I often regrettably see it dismissed as not a true issue because $latest_package_management_system fixes it.

Python has allowed me to be profoundly productive in many ways, but this is a huge sore spot for the Python ecosystem.

Re: Use `Python -m Pip`

#19

Python is a fun language but the ecosystem around it is horrible. It's a shame. I just want to pip install like I would a package manager

I think you mean the package management rather than the ecosystem. For all its failings, the python ecosystem (for machine learning / data science in particular) is unmatched, which is why python is so popular. As a "professional" python user (who got there in a roundabout way), I'd say the biggest problem with package management is all the conflicting advice and different ways to accomplish the same thing (there are…

As someone two months into their first python job - the ecosystem is solid for ML / data science, but there's a lot of places where it's painfully lacking.

I hate the most popular ORM (sqlalchemy) and alembic has a lot of footguns: for instance, if you autogenerate a migration where you change a table name, it will try to drop the old table and create a new one.

In web dev a lot of the OSS community has moved on to more appropriate or exciting languages, so the tools I'd normally reach for frequently are OSS projects that haven't been maintained in seven years.

As for pip: it needs a major version bump that creates a lockfile, or it needs to be intentionally sunset. It's easy for a beginner to start using (part of why it's heavily used), but extremely dangerous because of the lack of guarantees. I wish it didn't have as big of a footprint as it does.

Re: Use `Python -m Pip`

#20

I wish there was a way to lock the global python so you couldn't install packages to it by accident

On unixy systems, won't the system Python usually require root/sudo to install packages, whereas the ones in your environments will be owned by a less-privileged user?

And on Windows, you may have a globally installed Python (though there is little reason to have one instead of the Py launcher), but even if you do it's not a system Python that system components are relying on.

Post reply on HN