Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Don't recommend installing with pip install -U? #70

Open
baggiponte opened this issue Sep 10, 2024 · 2 comments
Open

[docs] Don't recommend installing with pip install -U? #70

baggiponte opened this issue Sep 10, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@baggiponte
Copy link

Hi there!

This is a bit nitpicky, but I would like to ask whether you would consider an update to your installation docs. While pip install --user is handy and immediate, it does not ensure isolation of the dependents. In other words, installation might fail if the user has a bunch of libraries installed this way; and by the way pip uninstall --user pathway only removes pathway and not the direct dependencies (sqlglot, etc).

The recommended way would be to point the user to using a virtual env:

python -m venv -- .venv
python -m pip install pathways

Or, if they wish to use pathways across multiple environments, the semi-recommended approach is to use pipx, or uv which does this amongst other things (it's basically cargo for Python).

What do you think? I'd be glad to submit a PR.

@baggiponte baggiponte added the enhancement New feature or request label Sep 10, 2024
@embe-pw
Copy link
Member

embe-pw commented Sep 12, 2024

I don't think we recommend using --user anywhere? Note that for -U in pip install is short for --upgrade, not --user.

I agree that using a separate environment (or even better some tool like poetry or uv) is probably best, but it seems to be a bit outside of the scope of our installation instructions. Maybe we could a note that installing in a separate environment is preferred? Do you have any suggestions of some documentation we could link to?

Additionally, not sure about uv, but AFAIK pipx does not allow installing libraries, only binaries (making the library globally available would not be too different from what pip install --user does with all its downsides...)

@baggiponte
Copy link
Author

Ops totally my bad! 😅

I agree that using a separate environment (or even better some tool like poetry or uv) is probably best, but it seems to be a bit outside of the scope of our installation instructions. Maybe we could a note that installing in a separate environment is preferred? Do you have any suggestions of some documentation we could link to?

Makes sense. As for the documentation: I was surprised by how little official documentation I could find clearly stating that "you must use a venv to develop software, otherwise there be dragons". Two refs:

  1. https://docs.python.org/3/library/venv.html
  2. https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments

I found a couple of things from the vscode docs but they also mention conda and I think it might generate more confusion than not. Oddly enough, there's an old reference from Princeton that mentions everything; though it mentions Python 3.7 since it dates back to 2015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
2 participants