Audrey M. Roy Greenfeld

Quietly building the future.

Virtualenv Is Not Managed by Rye

2024-07-07

 python3 -m venv .venv
 source .venv/bin/activate
 rye sync
error: virtualenv is not managed by rye. Run `rye sync -f` to force.

What happens when you force?

 rye sync -f
Forcing re-creation of non-rye managed virtualenv
Initializing new virtualenv in /Users/a/code/air-repos/air/.venv
Python version: cpython@3.12.3
Generating production lockfile: /Users/a/code/air-repos/air/requirements.lock
Generating dev lockfile: /Users/a/code/air-repos/air/requirements-dev.lock
Installing dependencies
   Built file:///~/code/air-repos/air                                                                    Built 1 editable in 506ms
Resolved 3 packages in 1ms
Downloaded 3 packages in 112ms
Installed 4 packages in 5ms
 + air==0.2.0 (from file:///~/code/air-repos/air)
 + jinja2==3.1.4
 + markdown==3.6
 + markupsafe==2.1.5
Done!

It appears that:

Now this runs without error:

 rye sync
Reusing already existing virtualenv
Generating production lockfile: ~/code/air-repos/air/requirements.lock
Generating dev lockfile: ~/code/air-repos/air/requirements-dev.lock
Installing dependencies
Audited 4 packages in 4ms
Done!