Does any sane person use python managed by Rye 😂
#1333
Replies: 3 comments 3 replies
|
Personally I very much prefer Rye's design choices in this regard. If I want to add You have a good point about the risk of accidentally doing The way I see it is that some of the problems with Python that Rye aims to solve emerge from common usage patterns. Solving them requires both proper tooling (e.g., Rye) and changes in habits. Therefore, there is significant tension between accommodating what Python users are accustomed to and tackling the challenges the tool is meant to address. |
|
@MatthewScholefield I would uno-reverse that on you and ask: "does any sane person install things into a global python environment" 😉 |
It allows you to do uv run --with requests example.pyAlso, Python recently added a standard format for inline script metadata. This allows the dependencies for a script to be declared in the script itself. # /// script
# dependencies = [
# "requests<3",
# "rich",
# ]
# ///
import requests
from rich.pretty import pprint
resp = requests.get("https://peps.python.org/api/peps.json")
data = resp.json()
pprint([(k, v["title"]) for k, v in data.items()][:10])And |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When installing

ryefor the first time it prompts for the desired behavior when runningpythonorpython3outside of a Rye managed project:At first, choosing the default options (Rye managed shim) seems like a no-brainer. But then I realized this catapults you into this weird state where you actually cannot use any global libraries you installed using
pip. This means that if I have some simple script that needs a common dependency likerequestsorclick, I can't just dopip install requests clickand thenpython3 simple_script.py; misleadingly,pip installsucceeds but thenpython3 simple_script.pystill fails withImportError.Similarly, if you do
pip install ipython, and then follow up withipython3, this will spawn Python using the system interpreter rather than the environment used bypython3. And runningrye install ipythonorpython3 -m pip install ipythonwill insert a third level of confusion.So my question, given all of this, is basically:
a. Insert a new Rye shim for
pipso that everything in the global environment refers to the same thing (and maybe remove therye install->rye script installalias to reduce confusion)b. Remove the rye-managed shim from the default option on the installer
c. Something else (comment)
I know I've been vocal about this already before (#1093), but I'm bringing it up again here because this confusion is one of the core reasons why I'm hesitant to recommend rye to my fellow developer friends. As a whole, I think
ryeis a wonderful tool in the Python ecosystem and deserves to be the de facto standard. However, as it stands right now, I feel that this default rye-managed environment option will significantly confuse new Python developers making them hate Python package management even more (relevant article).All reactions