GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python 3.12: ModuleNotFoundError: No module named 'setuptools' · Issue #1640 · gitpython-developers/GitPython

Python 3.12: ModuleNotFoundError: No module named 'setuptools' #1640

New issue
Copy link
New issue
Copy link
Closed
#1654
Closed
Python 3.12: ModuleNotFoundError: No module named 'setuptools'#1640
#1654
Copy link
Labels
acknowledgedhelp wanted

Description

@hugovk
hugovk
opened on Sep 3, 2023
Issue body actions

The Python 3.12 release candidate is out! 🚀

Call to action

We strongly encourage maintainers of third-party Python projects to prepare their projects for 3.12 compatibilities during this phase, and where necessary publish Python 3.12 wheels on PyPI to be ready for the final release of 3.12.0.

See also https://dev.to/hugovk/help-test-python-312-beta-1508/

Python 3.12.0 final will be released in one month: https://peps.python.org/pep-0693/


However, when adding 3.12 to the CI like hugovk@427164b, it fails with:

―――――――――――――――――――――― TestInstallation.test_installation ――――――――――――――――――――――

self = <test.test_installation.TestInstallation testMethod=test_installation>
rw_dir = '/tmp/test_installationo1a7a3rg'

    @with_rw_directory
    def test_installation(self, rw_dir):
        self.setUp_venv(rw_dir)
        result = subprocess.run(
            [self.pip, "install", "-r", "requirements.txt"],
            stdout=subprocess.PIPE,
            cwd=self.sources,
        )
        self.assertEqual(
            0,
            result.returncode,
            msg=result.stderr or result.stdout or "Can't install requirements",
        )
        result = subprocess.run(
            [self.python, "setup.py", "install"],
            stdout=subprocess.PIPE,
            cwd=self.sources,
        )
>       self.assertEqual(
            0,
            result.returncode,
            msg=result.stderr or result.stdout or "Can't build - setup.py failed",
        )
E       AssertionError: 0 != 1 : Can't build - setup.py failed

test/test_installation.py:39: AssertionError
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/home/runner/work/GitPython/GitPython/setup.py", line 2, in <module>
    from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'

Activity

  1. Byron
    added
    acknowledged
    help wanted
    on Sep 3, 2023
  2. EliahKagan commented on Sep 10, 2023

    @EliahKagan
    EliahKagan
    on Sep 10, 2023
    Member
    More actions

    This happens because, while the setuptools build backend remains supported including for projects like this one with setup.py files containing nontrivial logic, running setup.py directly is deprecated and, starting in Python 3.12, Python virtual (and global) environments no longer automatically have the setuptools package. See the ensurepip item in the list of removals in 3.12.

    The test_installation test runs python setup.py install. The solution is to use pip install . instead, or pip install -e . when an editable install is desired (in test_installation, the README.md, and elsewhere).

    I've opened #1654, which includes a fix for this issue.

  3. Byron
    closed this as completedin #1654on Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.