pypa / pypa/setuptools

Error when trying to access a private member of `distutils.sysconfig`

Open
#3,785 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Waiting User Feedback
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

setuptools version

setuptools == 66.1.1

Python version

python 3.9.8

OS

Kali 64bit

Additional environment information

This is only happening when i run in the pipenv

Description

i tried to insall pcapy in the pipenv but it failed with the output as shown in the console.

Expected behavior

expect to install the pcapy properly in the pipenv

How to Reproduce
  1. create env by running pipenv shell --python python3
  2. pipenv install pcapy
Output

Installing pypacker...
Installing pcapy...
⠋ Installing pcapy...[31m[1mError: [0m An error occurred while installing [32mpcapy[0m!
Error text: Collecting pcapy
  Using cached pcapy-0.11.4.tar.gz (37 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

[36m  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ujvd4y9h/pcapy_3219c8c9c8754c259483025e05a155a0/setup.py", line 49, in 
<module>
          save_init_posix = sysconfig._init_posix
      AttributeError: module 'distutils.sysconfig' has no attribute '_init_posix'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with pipenv shell --python python3 and pipenv install pcapy. Inspect pcapy’s setup.py at line 49, where it accesses distutils.sysconfig._init_posix, and determine whether the compatibility problem belongs in setuptools or pcapy. Done means establishing the correct project and a verified installation path or a confirmed fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.