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

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

Closed
takitsuba opened this issue Jul 16, 2023 · 15 comments

Comments

@takitsuba
Copy link

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: [email protected]
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/[email protected]/bin/pip-sync", line 5, in <module>
    from piptools.scripts.sync import cli
  File "/home/takizawa/.rye/pip-tools/[email protected]/lib/python3.11/site-packages/piptools/scripts/sync.py", line 16, in <module>
    from .. import sync
  File "/home/takizawa/.rye/pip-tools/[email protected]/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: [email protected]
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/[email protected]/bin/pip-sync", line 5, in <module>
    from piptools.scripts.sync import cli
  File "/home/takizawa/.rye/pip-tools/[email protected]/lib/python3.11/site-packages/piptools/scripts/sync.py", line 16, in <module>
    from .. import sync
  File "/home/takizawa/.rye/pip-tools/[email protected]/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
@eifinger
Copy link
Contributor

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

@T-256
Copy link
Contributor

T-256 commented Jul 16, 2023

fixed in jazzband/pip-tools#1906 you need to update it.

@zormit
Copy link

zormit commented Jul 16, 2023

how is it updated?

@mankeheaven
Copy link

how to update and fix it?

@ifplusor
Copy link
Contributor

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

@ifplusor
Copy link
Contributor

ifplusor commented Jul 17, 2023

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.

@eifinger
Copy link
Contributor

Maybe pip should be pinned when it is installed/upgrade during bootstrapping here: https://github.com/mitsuhiko/rye/blob/d36890c6ecd84a2f5e7ba882e8c1ee3399a3a83e/rye/src/bootstrap.rs#L146

@light4
Copy link
Contributor

light4 commented Jul 17, 2023

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

@takitsuba
Copy link
Author

takitsuba commented Jul 18, 2023

@light4 Thank you so much, I was able to solve my problem with it!

@mitsuhiko
Copy link
Collaborator

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 :-/

johannaengland added a commit to johannaengland/nav that referenced this issue Jul 28, 2023
Upgrades of pip and pip-compile broke the CI pipeline
More info can be found here: astral-sh/rye#368
johannaengland added a commit to johannaengland/nav that referenced this issue Jul 28, 2023
Upgrades of pip and pip-compile broke the CI pipeline
More info can be found here: astral-sh/rye#368
lunkwill42 pushed a commit to johannaengland/nav that referenced this issue Aug 4, 2023
Upgrades of pip and pip-compile broke the CI pipeline
More info can be found here: astral-sh/rye#368
@devturner
Copy link

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

@cnpryer
Copy link
Contributor

cnpryer commented Aug 14, 2023

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

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

@devturner
Copy link

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

💩

@andrewleech
Copy link

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!

@mitsuhiko
Copy link
Collaborator

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

0x29a added a commit to open-craft/edx-enterprise that referenced this issue Oct 30, 2023
0x29a added a commit to open-craft/edx-enterprise that referenced this issue Oct 30, 2023
0x29a added a commit to open-craft/edx-enterprise that referenced this issue Oct 30, 2023
0x29a added a commit to open-craft/edx-enterprise that referenced this issue Nov 18, 2023
0x29a added a commit to open-craft/edx-enterprise that referenced this issue Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests