rye: rye sync failed: ImportError: cannot import name 'DEV_PKGS' from 'pip._internal.commands.freeze'

Steps to Reproduce

I couldn’t execute rye sync as follows:

$ rye init test1502
success: Initialized project in /home/takizawa/Projects/test1502
  Run `rye sync` to get started
$ cd test1502/
$ rye sync
Initializing new virtualenv in /home/takizawa/Projects/test1502/.venv
Python version: cpython@3.11.3
Generating production lockfile: /home/takizawa/Projects/test1502/requirements.lock
Generating dev lockfile: /home/takizawa/Projects/test1502/requirements-dev.lock
Installing dependencies
Traceback (most recent call last):
  File "/home/takizawa/.rye/pip-tools/cpython@3.11/bin/pip-sync", line 5, in <module>
    from piptools.scripts.sync import cli
  File "/home/takizawa/.rye/pip-tools/cpython@3.11/lib/python3.11/site-packages/piptools/scripts/sync.py", line 16, in <module>
    from .. import sync
  File "/home/takizawa/.rye/pip-tools/cpython@3.11/lib/python3.11/site-packages/piptools/sync.py", line 11, in <module>
    from pip._internal.commands.freeze import DEV_PKGS
ImportError: cannot import name 'DEV_PKGS' from 'pip._internal.commands.freeze' (/tmp/.tmpQXWdp9/pip/_internal/commands/freeze.py)
error: Installation of dependencies failed

Expected Result

I assumed that rye sync would succeeded.

Actual Result

Please see above Steps to Reproduce

Version Info

$ rye --version
rye 0.10.0
commit: 0.10.0 (b822af9a2 2023-07-07)
platform: linux (x86_64)
self-python: cpython@3.11
symlink support: true

Stacktrace

$ rye sync
Reusing already existing virtualenv
Generating production lockfile: /home/takizawa/Projects/test1502/requirements.lock
Generating dev lockfile: /home/takizawa/Projects/test1502/requirements-dev.lock
Installing dependencies
Traceback (most recent call last):
  File "/home/takizawa/.rye/pip-tools/cpython@3.11/bin/pip-sync", line 5, in <module>
    from piptools.scripts.sync import cli
  File "/home/takizawa/.rye/pip-tools/cpython@3.11/lib/python3.11/site-packages/piptools/scripts/sync.py", line 16, in <module>
    from .. import sync
  File "/home/takizawa/.rye/pip-tools/cpython@3.11/lib/python3.11/site-packages/piptools/sync.py", line 11, in <module>
    from pip._internal.commands.freeze import DEV_PKGS
ImportError: cannot import name 'DEV_PKGS' from 'pip._internal.commands.freeze' (/tmp/.tmpitCNoU/pip/_internal/commands/freeze.py)
error: Installation of dependencies failed

Stack backtrace:
   0: rye::sync::sync
   1: rye::cli::sync::execute
   2: rye::cli::execute
   3: rye::main
   4: std::sys_common::backtrace::__rust_begin_short_backtrace
   5: std::rt::lang_start::{{closure}}
   6: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:287:13
      std::panicking::try::do_call
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:485:40
      std::panicking::try
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:449:19
      std::panic::catch_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panic.rs:140:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:148:48
      std::panicking::try::do_call
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:485:40
      std::panicking::try
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:449:19
      std::panic::catch_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panic.rs:140:14
      std::rt::lang_start_internal
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:148:20
   7: main

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 6
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

An easy and hacky way to fix for this : ~/.rye/self/bin/pip install -U pip==23.1

Sorry for the lack of update here. I’m a bit conflicted what to do. 7.0.0 has a bunch of bugs from my testing so I’m considering just downpinning pip for now 😕

This seems to happen since today. My daily build worked fine yesterday: https://github.com/eifinger/hass-fressnapf-tracker/actions/workflows/ci.yaml

fixed in https://github.com/jazzband/pip-tools/pull/1906 you need to update it.

you dropped support for python 3.7 … this does not work for me

fwiw https://devguide.python.org/versions/

jazzband/pip-tools#1906

After upgrading pip-tools to 7.0.0, another error occurred.

ERROR: The --python option must be placed before the pip subcommand name

I believe this issue should be resolved by pinning pip tools.

Yep 3.7 is officially end-of-life, I certainly support tools like rye only supporting python versions that are officially supported upstream!

For any users continuing to use unsupported / deprecated / end-of-life platforms like old python, well they also need to stick with old versions of the tools!

you must not move at the “speed of enterprise” - we still have python 2.7 in our repo that people are active with.

💩

jazzband/pip-tools#1906

After upgrading pip-tools to 7.0.0, another error occurred.

ERROR: The --python option must be placed before the pip subcommand name

After deleting --python option from --pip-args for pip-sync, it work.

how is it updated?