Error subprocess exited with error kivy

Kivy won't install in a venv created by Python 3.11.0 (released yesterday). (venv_3.11.0) C:UsersabcdePython>python -m pip install "kivy[base]" kivy_examples Collecting kivy[bas...

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


Open

Resonanz opened this issue

Oct 25, 2022

· 21 comments


Open

Kivy won’t install on Python 3.11.0

#8042

Resonanz opened this issue

Oct 25, 2022

· 21 comments

Comments

@Resonanz

Kivy won’t install in a venv created by Python 3.11.0 (released yesterday).

(venv_3.11.0) C:UsersabcdePython>python -m pip install "kivy[base]" kivy_examples
Collecting kivy[base]
  Downloading Kivy-2.1.0.tar.gz (23.8 MB)
     ---------------------------------------- 23.8/23.8 MB 3.9 MB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Collecting setuptools
        Using cached setuptools-65.5.0-py3-none-any.whl (1.2 MB)
      Collecting wheel
        Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
      Collecting cython!=0.27,!=0.27.2,<=0.29.28,>=0.24
        Downloading Cython-0.29.28-py2.py3-none-any.whl (983 kB)
           -------------------------------------- 983.8/983.8 kB 3.7 MB/s eta 0:00:00
      ERROR: Could not find a version that satisfies the requirement kivy_deps.gstreamer_dev~=0.3.3 (from versions: none)
      ERROR: No matching distribution found for kivy_deps.gstreamer_dev~=0.3.3
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
bartoszxkozlowski, gizix, yinjilong, tofi1130, keremkoseoglu, maorgur, JoaoEmanuell, flamesjames, LiyaKashapova, dirtbirb, and 8 more reacted with thumbs up emoji

@subhranil2605

@misl6

@Positive-Endeavour

@tofi1130

@keremkoseoglu

Same here. Had to go back to 3.10.4 for now.

@Resonanz

On Raspberry Pi, I cannot get Kivy to install with 3.10.8. Going back to 3.7.

@matham

@Resonanz

The issue on the Pi is different, and probably because Cython doesn’t seem to be available (https://www.piwheels.org/project/cython/).

Not sure sorry. Kivy does work very nicely on RPi if Python version is 3.7.3.

@misl6

FYI:

Even if we did not released Kivy 2.2.0 yet (and a new release might not happen soon, as there’s still some work to do), there are nighly wheels available with Python 3.11 support.
This is also a nice way to help us to test the latest cutting-edge features, bug fixes, and improvements.

From Kivy Docs: Nightly & pre-release wheels:

This will only install a development version of Kivy if one was released to PyPi. Instead, one can also install the latest cutting-edge Nightly wheels from the Kivy server with:

python -m pip install kivy --pre --no-deps --index-url  https://kivy.org/downloads/simple/
python -m pip install "kivy[base]" --pre --extra-index-url https://kivy.org/downloads/simple/

It is done in two steps, because otherwise pip may ignore the wheels on the server and install an older pre-release version from PyPi.

I will update this issue when we will land in RC phase for 2.2.0 😀

kamimiller, maorgur, abedhammoud, kengoon, tshirtman, Zalek4, lucifer7165, djkeu, Master-Hash, Zer0-Official, and 4 more reacted with thumbs up emoji
AlexandreCabana reacted with thumbs down emoji
maorgur, kengoon, and tofi1130 reacted with laugh emoji

@GoAmeer030

@Zer0-Official

@its-all-waves

> python -m pip install kivy --pre --no-deps --index-url  https://kivy.org/downloads/simple/
> python -m pip install "kivy[base]" --pre --extra-index-url https://kivy.org/downloads/simple/

This as a final step DOES work for me. Below is what I did leading up to this, in case any of these steps were prerequisites.
(I’m really not concerned with why right now, just needed an old project to run again. So, sorry if some of this is technically wrong. This sequence of events made my app run again.)

brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer

python -m pip install "kivy[base] @ https://github.com/kivy/kivy/archive/stable.zip"

python -m pip install "kivy[base]" kivy_examples --no-binary kiv

python -m pip install kivy --pre --no-deps --index-url https://kivy.org/downloads/simple/ python -m pip install "kivy[base]" --pre --extra-index-url https://kivy.org/downloads/simple/

@mvoltz

It looks like «kivy_deps.sdl2_dev» should be «kivy-deps.sdl2-dev» in whatever sub-process is checking for it.

@Jim707t

If you are waiting for a Kivy version that supports Python 3.11, you can use the Python 3.10 version if you have it installed on your PC. To create a virtual environment using Python 3.10, you can use the following command:

py -3.10 -m venv your_venv_name

This will work if you have one of the Python 3.10 version installed on your machine.

After activate your venv like This: your_venv_namescriptsactivate
Just run: py -m pip install kivy[full] kivy_examples

I think it should work!

@jetsgarcia

Just downgrade to version 10. I had the same problem but I uninstalled my 3.11.0 and now I’m using 3.10.4

@Jim707t

you can use several python version you will just create visual environment for the version you wanna use

benjiemc

added a commit
to benjiemc/snake-game
that referenced
this issue

Dec 27, 2022

@benjiemc

Kivy currently does not build for python 3.11. See issue
[here](kivy/kivy#8042).

@NeoNature

If you are waiting for a Kivy version that supports Python 3.11, you can use the Python 3.10 version if you have it installed on your PC. To create a virtual environment using Python 3.10, you can use the following command:

py -3.10 -m venv your_venv_name

This will work if you have one of the Python 3.10 version installed on your machine.

After activate your venv like This: your_venv_namescriptsactivate Just run: py -m pip install kivy[full] kivy_examples

I think it should work!

Yesss..!! It Works..!! Thanks..!!

@ashb

For anyone using poetry this worked for me

poetry source add --secondary kivy https://kivy.org/downloads/simple/
poetry add --allow-prereleases --source kivy kivy

@7263-8

Yeh this works, I re downloaded Python 3.10 , and then added it into the interpreter list of my project. Then the package Kivy was installed successfully.

@Zackariyya

I got it working with python 3.11 by installed the latest cutting-edge:
python -m pip install "kivy[base] @ https://github.com/kivy/kivy/archive/master.zip"

@cebu23

python -m pip install "kivy[base,media] @ https://github.com/kivy/kivy/archive/master.zip" also worked for me on Python 3.11 on Windows 11, looks like the media components are working from very limited testing.

I’m a brand new Kivy user (installing it to play with it for the very first time), so not really qualified for troubleshooting — however, I did notice that in the kivy-examples demo showcase, the Bubbles demo fails with kivy.uix.bubble.BubbleException: Bubble can only contain a single Widget or Layout . On my Linux box running v2.1.0 on Python 3.10.6 the Bubbles demo works fine.

Содержание

  1. Subprocess exited with error pip
  2. Check if your Python version is supported by the package #
  3. Create a virtual environment #
  4. Try running pip install in verbose mode #
  5. Conclusion #
  6. Pip 22.1 (only) fails when included in pyproject.toml #11120
  7. Comments
  8. Description
  9. Expected behavior
  10. pip version
  11. Python version
  12. How to Reproduce
  13. Output
  14. Code of Conduct
  15. Can’t install #433
  16. Comments
  17. I am trying to install the package but pip keeps failing. The error I get is this:
  18. Ошибка подпроцесса при установке Kivy на Windows. Что делать?

Subprocess exited with error pip

The —use-deprecated option allows us to use the old resolver behavior when installing modules.

If the suggestions didn’t help, read toward the end of your error message.

It might contain information such as: «RuntimeError: Cannot install on Python version 3.11.0; only versions >=3.7, pip install the package from the error message before installing the other package.

Another common cause of the error is misspelling the name of the package and trying to install some broken, obsolete module by mistake.

Check if your Python version is supported by the package #

The error «note: This error originates from a subprocess, and is likely not a problem with pip» is sometimes caused when the package you are trying to install doesn’t have available wheels for your version of Python.

You can check your Python version with the python —version command.

You can check if a package has wheels available for a specific Python version in the Download files section of the package’s pypi page.

If the .whl files are not available for your version of Python, you can download an older version.

The —pre option makes it so pip includes pre-release and development versions of the package. By default pip only finds stable versions.

If that didn’t work, you can download a specific Python version that is supported by the package if the package doesn’t support the latest Python version.

Different versions are available in the «Looking for a specific release» table.

Make sure to tick the following options if you get prompted:

  • Install launcher for all users (recommended)
  • Add Python to PATH (this adds Python to your PATH environment variable)

If that didn’t help and you don’t already have a virtual environment, try creating one.

Create a virtual environment #

To solve the «note: This error originates from a subprocess, and is likely not a problem with pip» error:

  1. Create a virtual environment.
  2. Activate the virtual environment.
  3. Run the pip install command with the virtual environment active.

Make sure to use the correct command to activate your virtual environment depending on your operating system and your shell.

Your virtual environment will use the version of Python that was used to create it.

Try running pip install in verbose mode #

If none of the suggestions helped, try running the pip install command in verbose mode.

The -v option stands for verbose mode and can be used up to 3 times.

When the pip install command is run in verbose mode, the command shows more output and how the error occurred.

Conclusion #

To solve the error «note: This error originates from a subprocess, and is likely not a problem with pip»:

  1. Upgrade your versions of pip , setuptools and wheel .
  2. Make sure you haven’t got any missing dependencies.
  3. Make sure your Python version is supported by the package.

Источник

Pip 22.1 (only) fails when included in pyproject.toml #11120

Description

Starting with pip 22.1, including «pip» in the pyproject.toml [build-system] requires fails.

Verified that this succeeds with pip 22.0.4

This error message repeatedly states that this is likely not a problem with pip. but it is the change from pip 22.0.4 to 22.1 that breaks it.

Expected behavior

I expect pip 22.1 to behave the same as pip 22.0.4; namely, that the installation succeeds.

Output when using pip 22.0.4:

pip version

Python version

Windows 11 (21H2)

How to Reproduce

  1. Create a virtual environment and activate it
  2. Install pip 22.1
  3. Create a python package with a pyproject.toml containing:
  1. Install this python package from the local directory with python -m pip install
  2. Observe the error

Output

Code of Conduct

The text was updated successfully, but these errors were encountered:

You shouldn’t have pip in build-requires in the first place — why do you think you need it there?

The reason it’s failing is a somewhat complex combination of the fact that pip is already in the build environment to install everything else, pip can’t upgrade itself on Windows unless it’s invoked via python -m pip , and when setting up the build environment it looks like we invoke pip rather than python -m pip . It’s probably fixable, but messy to do so.

I don’t think this is worth fixing because you shouldn’t have pip in build-requires in the first place.

This might be something that we could prevent — I don’t have a Windows machine to be able to see why/what is happening. What’s happening here is that the environment is basically triggering the logic meant to protect users from a broken pip installation on Windows (see #1299).

It’s unclear to me why that’s happening, but we might have a spot where code needs to change from pip . to sys.executable -m pip . in the codebase — or some edge case that needs to be accounted for?

If someone is able to reproduce this, please plug a debugger into pip and share the values in the locals() and sys.argv[0] at:

modifying_pip and WINDOWS and os . path . basename ( sys . argv [ 0 ]) in pip_names

This error message repeatedly states that this is likely not a problem with pip.

Yea, this happening in a build step, where the typical failure is things like the package not having the appropriate build-time dependencies installed. The use of the word likely points toward that. 🙂

@pradyunsg this is indeed probably the solution, although we may be invoking the build environment’s pip at this point, so sys.executable might be the wrong thing to use.

As I say, it’s possible, but tricky, and I’d like to know why the OP wants to include pip in build-system.requires before we «fix» this.

Bah, you’re right — I missed that nuance. 🙂

You shouldn’t have pip in build-requires in the first place — why do you think you need it there?

. I had no reason to think it didn’t need to be there? It needs setuptools and wheel to be there. Why do those need to be there and not pip? The documentation states that build-system.requires is a list of requirement specifiers for build-time dependencies of a package. It seems like pip is a build-time dependency of my package. I don’t see how it can pip install if the user doesn’t even have pip.

If no pyproject.toml should ever have pip in build-system.requires , then the documentation does not make this clear.

If no pyproject.toml should ever have pip in build-system.requires, then the documentation does not make this clear.

build-system.requires is intended to be «the things you need in the environment order to build the project». It’s the front end’s responsibility to install those items into the environment and to call the build_wheel hook of the backend in that environment. That build frontend might be pip or it might be something else. But it doesn’t need to be in the environment because it orchestrates the creation and use of that environment.

I don’t think it ever occurred to me that people might think pip needed to be added into the build environment. If you were building a wheel using build would you expect to put build in there? How can you know what frontend the user is invoking? But if you have a suggestion for improving the documentation, that would be great! I guess the first question is which documentation you’d want to improve — this stuff is generally covered in packaging.python.org, not in pip’s documentation, so a PR there might be the best approach.

This is covered in pip’s documentation, as part of https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#build-time-dependencies, which might be the sentence that is the source of the confusion here.

Is this still happening in 22.1.1?

. I had no reason to think it didn’t need to be there? It needs setuptools and wheel to be there

Why does wheel need to be there? Setuptools lists it as a dependency for building wheels and is automatically installed when necessary.

It used to not do that, in earlier versions of setuptools.

Источник

Can’t install #433

I am trying to install the package but pip keeps failing. The error I get is this:

Collecting PyBluez
Using cached PyBluez-0.23.tar.gz (97 kB)
Preparing metadata (setup.py) . error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in PyBluez setup command: use_2to3 is invalid.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

The text was updated successfully, but these errors were encountered:

— a caller that pip uses to run setup.py # # — It imports setuptools before invoking setup.py, to enable projects that directly # import from `distutils.core` to work with newer packaging standards. # — It provides a clear error message when setuptools is not installed. # — It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so # setuptools doesn’»‘»‘t think the script is `-c`. This avoids the following warning: # manifest_maker: standard file ‘»‘»‘-c’»‘»‘ not found». # — It generates a shim setup.py, for handling setup.cfg-only projects. import os, sys, tokenize try: import setuptools except ImportError as error: print( «ERROR: Can not execute `setup.py` since setuptools is not available in » «the build environment.», file=sys.stderr, ) sys.exit(1) __file__ = %r sys.argv[0] = __file__ if os.path.exists(__file__): filename = __file__ with tokenize.open(__file__) as f: setup_py_code = f.read() else: filename = «» setup_py_code = «from setuptools import setup; setup()» exec(compile(setup_py_code, filename, «exec»)) ‘»‘»»»‘»»»‘»‘ % (‘»‘»‘/tmp/pip-install-68qwtmvz/pybluez_c1c9b215cbe7493a9f160507e1e4e9c2/setup.py’»‘»‘,), «

«, «exec»))’ egg_info —egg-base /tmp/pip-pip-egg-info-ew_2egyz cwd: /tmp/pip-install-68qwtmvz/pybluez_c1c9b215cbe7493a9f160507e1e4e9c2/ Preparing metadata (setup.py) . error error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. «>

Related issues (did not check them for solutions yet):
#413 #424 #431

This was fixed in #431 — Solution for now, until a new release is pushed to pypi is:

Источник

Ошибка подпроцесса при установке Kivy на Windows. Что делать?

Я пытался установить Kivy через pip по инструкции с официального сайта, однако, при попытке установки консоль выдаёт следующую ошибку:

Если это важно, у меня стоит python 3.10.

Как решить данную проблему?

  • Вопрос задан 06 февр. 2022
  • 3479 просмотров

Потихонечку откатываемся на python 3.8

Также, если есть желание, перед установкой любой библиотеки, желательно почитать офф. инструкцию по установке:
Kivy 2.0.0 officially supports Python versions 3.6 — 3.9. — второе предложение в инструкции!

Потихонечку откатываемся на python 3.8

А если серьёзно, у вас он работает с 3.9?

3.7, 3.8, 3.9 — тут вообще без разницы, абсолютно.

Тем более, последние версии не опытным пользователям привозят только вагон и маленькую тележку проблем.

Если без разницы, тогда почему 3.8?

Какие проблемы привозит 3.9 в отличие от 3.8?

Как вариант, меньшее количество пакетов, доступных через pip install. Конечно, можно большинство пакетов в Python 3.9, 3.10. установить из исходников, но новички этим заниматься не будут!

Источник

Subprocess exited with error pip

The —use-deprecated option allows us to use the old resolver behavior when installing modules.

If the suggestions didn’t help, read toward the end of your error message.

It might contain information such as: «RuntimeError: Cannot install on Python version 3.11.0; only versions >=3.7, pip install the package from the error message before installing the other package.

Another common cause of the error is misspelling the name of the package and trying to install some broken, obsolete module by mistake.

Check if your Python version is supported by the package #

The error «note: This error originates from a subprocess, and is likely not a problem with pip» is sometimes caused when the package you are trying to install doesn’t have available wheels for your version of Python.

You can check your Python version with the python —version command.

You can check if a package has wheels available for a specific Python version in the Download files section of the package’s pypi page.

If the .whl files are not available for your version of Python, you can download an older version.

The —pre option makes it so pip includes pre-release and development versions of the package. By default pip only finds stable versions.

If that didn’t work, you can download a specific Python version that is supported by the package if the package doesn’t support the latest Python version.

Different versions are available in the «Looking for a specific release» table.

Make sure to tick the following options if you get prompted:

  • Install launcher for all users (recommended)
  • Add Python to PATH (this adds Python to your PATH environment variable)

If that didn’t help and you don’t already have a virtual environment, try creating one.

Create a virtual environment #

To solve the «note: This error originates from a subprocess, and is likely not a problem with pip» error:

  1. Create a virtual environment.
  2. Activate the virtual environment.
  3. Run the pip install command with the virtual environment active.

Make sure to use the correct command to activate your virtual environment depending on your operating system and your shell.

Your virtual environment will use the version of Python that was used to create it.

Try running pip install in verbose mode #

If none of the suggestions helped, try running the pip install command in verbose mode.

The -v option stands for verbose mode and can be used up to 3 times.

When the pip install command is run in verbose mode, the command shows more output and how the error occurred.

Conclusion #

To solve the error «note: This error originates from a subprocess, and is likely not a problem with pip»:

  1. Upgrade your versions of pip , setuptools and wheel .
  2. Make sure you haven’t got any missing dependencies.
  3. Make sure your Python version is supported by the package.

Источник

Ошибка подпроцесса при установке Kivy на Windows. Что делать?

Я пытался установить Kivy через pip по инструкции с официального сайта, однако, при попытке установки консоль выдаёт следующую ошибку:

Если это важно, у меня стоит python 3.10.

Как решить данную проблему?

  • Вопрос задан 06 февр. 2022
  • 3450 просмотров

Потихонечку откатываемся на python 3.8

Также, если есть желание, перед установкой любой библиотеки, желательно почитать офф. инструкцию по установке:
Kivy 2.0.0 officially supports Python versions 3.6 — 3.9. — второе предложение в инструкции!

Потихонечку откатываемся на python 3.8

А если серьёзно, у вас он работает с 3.9?

3.7, 3.8, 3.9 — тут вообще без разницы, абсолютно.

Тем более, последние версии не опытным пользователям привозят только вагон и маленькую тележку проблем.

Если без разницы, тогда почему 3.8?

Какие проблемы привозит 3.9 в отличие от 3.8?

Как вариант, меньшее количество пакетов, доступных через pip install. Конечно, можно большинство пакетов в Python 3.9, 3.10. установить из исходников, но новички этим заниматься не будут!

Источник

Pip 22.1 (only) fails when included in pyproject.toml #11120

Comments

cowlinator commented May 14, 2022 •

Description

Starting with pip 22.1, including «pip» in the pyproject.toml [build-system] requires fails.

Verified that this succeeds with pip 22.0.4

This error message repeatedly states that this is likely not a problem with pip. but it is the change from pip 22.0.4 to 22.1 that breaks it.

Expected behavior

I expect pip 22.1 to behave the same as pip 22.0.4; namely, that the installation succeeds.

Output when using pip 22.0.4:

pip version

Python version

Windows 11 (21H2)

How to Reproduce

  1. Create a virtual environment and activate it
  2. Install pip 22.1
  3. Create a python package with a pyproject.toml containing:
  1. Install this python package from the local directory with python -m pip install
  2. Observe the error

Output

Code of Conduct

The text was updated successfully, but these errors were encountered:

pfmoore commented May 14, 2022

You shouldn’t have pip in build-requires in the first place — why do you think you need it there?

The reason it’s failing is a somewhat complex combination of the fact that pip is already in the build environment to install everything else, pip can’t upgrade itself on Windows unless it’s invoked via python -m pip , and when setting up the build environment it looks like we invoke pip rather than python -m pip . It’s probably fixable, but messy to do so.

I don’t think this is worth fixing because you shouldn’t have pip in build-requires in the first place.

pradyunsg commented May 14, 2022

This might be something that we could prevent — I don’t have a Windows machine to be able to see why/what is happening. What’s happening here is that the environment is basically triggering the logic meant to protect users from a broken pip installation on Windows (see #1299).

It’s unclear to me why that’s happening, but we might have a spot where code needs to change from pip . to sys.executable -m pip . in the codebase — or some edge case that needs to be accounted for?

If someone is able to reproduce this, please plug a debugger into pip and share the values in the locals() and sys.argv[0] at:

modifying_pip and WINDOWS and os . path . basename ( sys . argv [ 0 ]) in pip_names

pradyunsg commented May 14, 2022

This error message repeatedly states that this is likely not a problem with pip.

Yea, this happening in a build step, where the typical failure is things like the package not having the appropriate build-time dependencies installed. The use of the word likely points toward that. 🙂

pfmoore commented May 14, 2022

@pradyunsg this is indeed probably the solution, although we may be invoking the build environment’s pip at this point, so sys.executable might be the wrong thing to use.

As I say, it’s possible, but tricky, and I’d like to know why the OP wants to include pip in build-system.requires before we «fix» this.

pradyunsg commented May 14, 2022

Bah, you’re right — I missed that nuance. 🙂

cowlinator commented May 20, 2022 •

You shouldn’t have pip in build-requires in the first place — why do you think you need it there?

. I had no reason to think it didn’t need to be there? It needs setuptools and wheel to be there. Why do those need to be there and not pip? The documentation states that build-system.requires is a list of requirement specifiers for build-time dependencies of a package. It seems like pip is a build-time dependency of my package. I don’t see how it can pip install if the user doesn’t even have pip.

If no pyproject.toml should ever have pip in build-system.requires , then the documentation does not make this clear.

pfmoore commented May 20, 2022

If no pyproject.toml should ever have pip in build-system.requires, then the documentation does not make this clear.

build-system.requires is intended to be «the things you need in the environment order to build the project». It’s the front end’s responsibility to install those items into the environment and to call the build_wheel hook of the backend in that environment. That build frontend might be pip or it might be something else. But it doesn’t need to be in the environment because it orchestrates the creation and use of that environment.

I don’t think it ever occurred to me that people might think pip needed to be added into the build environment. If you were building a wheel using build would you expect to put build in there? How can you know what frontend the user is invoking? But if you have a suggestion for improving the documentation, that would be great! I guess the first question is which documentation you’d want to improve — this stuff is generally covered in packaging.python.org, not in pip’s documentation, so a PR there might be the best approach.

pradyunsg commented May 21, 2022

This is covered in pip’s documentation, as part of https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#build-time-dependencies, which might be the sentence that is the source of the confusion here.

pradyunsg commented May 21, 2022

Is this still happening in 22.1.1?

agronholm commented May 21, 2022

. I had no reason to think it didn’t need to be there? It needs setuptools and wheel to be there

Why does wheel need to be there? Setuptools lists it as a dependency for building wheels and is automatically installed when necessary.

pradyunsg commented May 22, 2022

It used to not do that, in earlier versions of setuptools.

Источник

Pip 22.1 (only) fails when included in pyproject.toml #11120

Comments

cowlinator commented May 14, 2022 •

Description

Starting with pip 22.1, including «pip» in the pyproject.toml [build-system] requires fails.

Verified that this succeeds with pip 22.0.4

This error message repeatedly states that this is likely not a problem with pip. but it is the change from pip 22.0.4 to 22.1 that breaks it.

Expected behavior

I expect pip 22.1 to behave the same as pip 22.0.4; namely, that the installation succeeds.

Output when using pip 22.0.4:

pip version

Python version

Windows 11 (21H2)

How to Reproduce

  1. Create a virtual environment and activate it
  2. Install pip 22.1
  3. Create a python package with a pyproject.toml containing:
  1. Install this python package from the local directory with python -m pip install
  2. Observe the error

Output

Code of Conduct

The text was updated successfully, but these errors were encountered:

pfmoore commented May 14, 2022

You shouldn’t have pip in build-requires in the first place — why do you think you need it there?

The reason it’s failing is a somewhat complex combination of the fact that pip is already in the build environment to install everything else, pip can’t upgrade itself on Windows unless it’s invoked via python -m pip , and when setting up the build environment it looks like we invoke pip rather than python -m pip . It’s probably fixable, but messy to do so.

I don’t think this is worth fixing because you shouldn’t have pip in build-requires in the first place.

pradyunsg commented May 14, 2022

This might be something that we could prevent — I don’t have a Windows machine to be able to see why/what is happening. What’s happening here is that the environment is basically triggering the logic meant to protect users from a broken pip installation on Windows (see #1299).

It’s unclear to me why that’s happening, but we might have a spot where code needs to change from pip . to sys.executable -m pip . in the codebase — or some edge case that needs to be accounted for?

If someone is able to reproduce this, please plug a debugger into pip and share the values in the locals() and sys.argv[0] at:

modifying_pip and WINDOWS and os . path . basename ( sys . argv [ 0 ]) in pip_names

pradyunsg commented May 14, 2022

This error message repeatedly states that this is likely not a problem with pip.

Yea, this happening in a build step, where the typical failure is things like the package not having the appropriate build-time dependencies installed. The use of the word likely points toward that. 🙂

pfmoore commented May 14, 2022

@pradyunsg this is indeed probably the solution, although we may be invoking the build environment’s pip at this point, so sys.executable might be the wrong thing to use.

As I say, it’s possible, but tricky, and I’d like to know why the OP wants to include pip in build-system.requires before we «fix» this.

pradyunsg commented May 14, 2022

Bah, you’re right — I missed that nuance. 🙂

cowlinator commented May 20, 2022 •

You shouldn’t have pip in build-requires in the first place — why do you think you need it there?

. I had no reason to think it didn’t need to be there? It needs setuptools and wheel to be there. Why do those need to be there and not pip? The documentation states that build-system.requires is a list of requirement specifiers for build-time dependencies of a package. It seems like pip is a build-time dependency of my package. I don’t see how it can pip install if the user doesn’t even have pip.

If no pyproject.toml should ever have pip in build-system.requires , then the documentation does not make this clear.

pfmoore commented May 20, 2022

If no pyproject.toml should ever have pip in build-system.requires, then the documentation does not make this clear.

build-system.requires is intended to be «the things you need in the environment order to build the project». It’s the front end’s responsibility to install those items into the environment and to call the build_wheel hook of the backend in that environment. That build frontend might be pip or it might be something else. But it doesn’t need to be in the environment because it orchestrates the creation and use of that environment.

I don’t think it ever occurred to me that people might think pip needed to be added into the build environment. If you were building a wheel using build would you expect to put build in there? How can you know what frontend the user is invoking? But if you have a suggestion for improving the documentation, that would be great! I guess the first question is which documentation you’d want to improve — this stuff is generally covered in packaging.python.org, not in pip’s documentation, so a PR there might be the best approach.

pradyunsg commented May 21, 2022

This is covered in pip’s documentation, as part of https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#build-time-dependencies, which might be the sentence that is the source of the confusion here.

pradyunsg commented May 21, 2022

Is this still happening in 22.1.1?

agronholm commented May 21, 2022

. I had no reason to think it didn’t need to be there? It needs setuptools and wheel to be there

Why does wheel need to be there? Setuptools lists it as a dependency for building wheels and is automatically installed when necessary.

pradyunsg commented May 22, 2022

It used to not do that, in earlier versions of setuptools.

Источник

Здравствуйте форумчане!
Первый раз с таким сталкиваюсь.
Пробовал переустанавливать python не помогло.
Полный текст ошибки из консоли:
(pythonparse) PS C:gitgit_practice> pip install lxml
Collecting lxml
Downloading lxml-4.9.1.tar.gz (3.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 2.0 MB/s eta 0:00:00
Preparing metadata (setup.py) … done
Installing collected packages: lxml
DEPRECATION: lxml is being installed using the legacy ‘setup.py install’ method, because it does not have a ‘pyproject.toml’ and the ‘wheel’ package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the ‘—use-pep517’ option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for lxml … error
error: subprocess-exited-with-error

× Running setup.py install for lxml did not run successfully.
│ exit code: 1
╰─> [76 lines of output]
Building lxml version 4.9.1.
Building without Cython.
Building against pre-built libxml2 andl libxslt libraries
running install
C:gitgit_practicepythonparseLibsite-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating buildlib.win-amd64-cpython-311
creating buildlib.win-amd64-cpython-311lxml
copying srclxmlbuilder.py -> buildlib.win-amd64-cpython-311lxml
copying srclxmlcssselect.py -> buildlib.win-amd64-cpython-311lxml
copying srclxmldoctestcompare.py -> buildlib.win-amd64-cpython-311lxml
copying srclxmlElementInclude.py -> buildlib.win-amd64-cpython-311lxml
copying srclxmlpyclasslookup.py -> buildlib.win-amd64-cpython-311lxml
copying srclxmlsax.py -> buildlib.win-amd64-cpython-311lxml
copying srclxmlusedoctest.py -> buildlib.win-amd64-cpython-311lxml
copying srclxml_elementpath.py -> buildlib.win-amd64-cpython-311lxml
copying srclxml__init__.py -> buildlib.win-amd64-cpython-311lxml
creating buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludes__init__.py -> buildlib.win-amd64-cpython-311lxmlincludes
creating buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmlbuilder.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmlclean.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmldefs.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmldiff.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmlElementSoup.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmlformfill.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmlhtml5parser.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmlsoupparser.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtmlusedoctest.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtml_diffcommand.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtml_html5builder.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtml_setmixin.py -> buildlib.win-amd64-cpython-311lxmlhtml
copying srclxmlhtml__init__.py -> buildlib.win-amd64-cpython-311lxmlhtml
creating buildlib.win-amd64-cpython-311lxmlisoschematron
copying srclxmlisoschematron__init__.py -> buildlib.win-amd64-cpython-311lxmlisoschematron
copying srclxmletree.h -> buildlib.win-amd64-cpython-311lxml
copying srclxmletree_api.h -> buildlib.win-amd64-cpython-311lxml
copying srclxmllxml.etree.h -> buildlib.win-amd64-cpython-311lxml
copying srclxmllxml.etree_api.h -> buildlib.win-amd64-cpython-311lxml
copying srclxmlincludesc14n.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesconfig.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesdtdvalid.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesetreepublic.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludeshtmlparser.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesrelaxng.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesschematron.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludestree.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesuri.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesxinclude.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesxmlerror.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesxmlparser.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesxmlschema.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesxpath.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesxslt.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludes__init__.pxd -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludesetree_defs.h -> buildlib.win-amd64-cpython-311lxmlincludes
copying srclxmlincludeslxml-version.h -> buildlib.win-amd64-cpython-311lxmlincludes
creating buildlib.win-amd64-cpython-311lxmlisoschematronresources
creating buildlib.win-amd64-cpython-311lxmlisoschematronresourcesrng
copying srclxmlisoschematronresourcesrngiso-schematron.rng -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesrng
creating buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsl
copying srclxmlisoschematronresourcesxslRNG2Schtrn.xs l -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsl
copying srclxmlisoschematronresourcesxslXSD2Schtrn.xs l -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsl
creating buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_abstract_expand.xsl -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_dsdl_include.xsl -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_schematron_message.xsl -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_schematron_skeleton_for_xslt1.xsl -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_svrl_for_xslt1.xsl -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1readme.txt -> buildlib.win-amd64-cpython-311lxmlisoschematronresourcesxsliso-schematron-xslt1
running build_ext
building ‘lxml.etree’ extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with «Microsoft C++ Build Tools»: https://visualstudio.microsoft… ild-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> lxml

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

Windows10
Python 3.10.3
я его скачивал и он выдал c начало одну ошибку, но я её не запомнил потом переустановил Python и снова попробовал установить и выдаёт огромную ошибку
error: subprocess-exited-with-error

× Running setup.py install for wxPython did not run successfully.
│ exit code: 1
╰─> [51 lines of output]
C:UsersuserAppDataLocalProgramsPythonPython310libsite-packagessetuptoolsdist.py:717: UserWarning: Usage of dash-separated ‘license-file’ will not be supported in future versions. Please use the underscore name ‘license_file’ instead
warnings.warn(
C:UsersuserAppDataLocalProgramsPythonPython310libsite-packagessetuptoolsdist.py:294: DistDeprecationWarning: use_2to3 is ignored.
warnings.warn(f»{attr} is ignored.», DistDeprecationWarning)
running install
running build
C:UsersuserAppDataLocalTemppip-install-oaw50g0cwxpython_8c0d0c6bad644d94a3a3ba6a119b91b4build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.dep_util import newer, newer_group
Will build using: «C:UsersuserAppDataLocalProgramsPythonPython310python.exe»
3.10.3 (tags/v3.10.3:a342a49, Mar 16 2022, 13:07:40) [MSC v.1929 64 bit (AMD64)]
Python’s architecture is 64bit
cfg.VERSION: 4.1.1

Running command: build
Running command: build_wx
Command ‘»C:UsersuserAppDataLocalProgramsPythonPython310python.exe» -c «import setuptools, distutils.msvc9compiler as msvc; mc = msvc.MSVCCompiler(); mc.initialize(); print(mc.cc)»‘ failed with exit code 1.
Traceback (most recent call last):

File «<string>», line 1, in <module>

File «C:UsersuserAppDataLocalProgramsPythonPython310libdistutilsmsvc9compiler.py», line 371, in initialize

vc_env = query_vcvarsall(VERSION, plat_spec)

File «C:UsersuserAppDataLocalProgramsPythonPython310libsite-packagessetuptoolsmsvc.py», line 140, in msvc9_query_vcvarsall

return EnvironmentInfo(arch, ver).return_env()

File «C:UsersuserAppDataLocalProgramsPythonPython310libsite-packagessetuptoolsmsvc.py», line 1740, in return_env

[self.VCIncludes,

File «C:UsersuserAppDataLocalProgramsPythonPython310libsite-packagessetuptoolsmsvc.py», line 1282, in VCIncludes

return [join(self.si.VCInstallDir, ‘Include’),

File «C:UsersuserAppDataLocalProgramsPythonPython310libsite-packagessetuptoolsmsvc.py», line 840, in VCInstallDir

raise distutils.errors.DistutilsPlatformError(msg)

distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required. Get it with «Microsoft C++ Build Tools»: https://visualstudio.microsoft.com/visual-cpp-build-tools/
Finished command: build_wx (0m1.189s)
Finished command: build (0m1.189s)
WARNING: Building this way assumes that all generated files have been
generated already. If that is not the case then use build.py directly
to generate the source and perform the build stage. You can use
—skip-build with the bdist_* or install commands to avoid this
message and the wxWidgets and Phoenix build steps in the future.

«C:UsersuserAppDataLocalProgramsPythonPython310python.exe» -u build.py build
Command ‘»C:UsersuserAppDataLocalProgramsPythonPython310python.exe» -u build.py build’ failed with exit code 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> wxPython

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Помогите, пожалуйста!

Понравилась статья? Поделить с друзьями:
  • Error sub process usr bin dpkg returned error code 1 как исправить
  • Error strtrim s argument must be a string or cellstring
  • Error strtok was not declared in this scope
  • Error strlen was not declared in this scope
  • Error strings dat file not found