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 — BUG: __pycache__ directory included in 3.11 wheels · Issue #31392 · numpy/numpy

BUG: __pycache__ directory included in 3.11 wheels #31392

New issue
Copy link
New issue
Copy link
Closed
#31397
Closed
BUG: __pycache__ directory included in 3.11 wheels#31392
#31397
Copy link
Labels
00 - Bug

Description

@vfazio
vfazio
opened on May 5, 2026
Issue body actions

Describe the issue:

Just noticed this when using installer:

/opt/poetry/venv/lib/python3.11/site-packages/poetry/installation/wheel_installer.py:129: RuntimeWarning: Skip installing numpy/distutils/__pycache__/conv_template.cpython-311.pyc from numpy. Installing files in a __pycache__ directory poses a security risk. __pycache__ directories should not be included in wheels. This is probably an issue in the build process of 'numpy'.

Looks like this is getting generated as part of the build somehow but not getting pruned and eventually getting packed up in the wheel.

I was testing with 2.2.6 but i see this same directory in the 2.4.4 wheel too.

Reproduce the code example:

(.venv) vfazio@vfazio4:/tmp/tmp.ewJOTkFq1w$ wget https://files.pythonhosted.org/packages/cf/c5/9fcb7e0e69cef59cf10c746b84f7d58b08bc66a6b7d459783c5a4f6101a6/numpy-2.4.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
--2026-05-05 12:51:42--  https://files.pythonhosted.org/packages/cf/c5/9fcb7e0e69cef59cf10c746b84f7d58b08bc66a6b7d459783c5a4f6101a6/numpy-2.4.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Resolving files.pythonhosted.org (files.pythonhosted.org)... 151.101.192.223, 151.101.64.223, 151.101.0.223, ...
Connecting to files.pythonhosted.org (files.pythonhosted.org)|151.101.192.223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16925137 (16M) [application/octet-stream]
Saving to: ‘numpy-2.4.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl’

numpy-2.4.4-cp311-cp311-manylinux_2_27_x86_64.m 100%[======================================================================================================>]  16.14M  3.43MB/s    in 6.0s    

2026-05-05 12:51:49 (2.68 MB/s) - ‘numpy-2.4.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl’ saved [16925137/16925137]

(.venv) vfazio@vfazio4:/tmp/tmp.ewJOTkFq1w$ unzip -t numpy-2.4.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | grep __pycache__
    testing: numpy/distutils/__pycache__/   OK
    testing: numpy/distutils/__pycache__/conv_template.cpython-311.pyc   OK

Error message:

/opt/poetry/venv/lib/python3.11/site-packages/poetry/installation/wheel_installer.py:129: RuntimeWarning: Skip installing numpy/distutils/__pycache__/conv_template.cpython-311.pyc from numpy. Installing files in a __pycache__ directory poses a security risk. __pycache__ directories should not be included in wheels. This is probably an issue in the build process of 'numpy'.

Python and NumPy Versions:

python 3.11

numpy 2.2.6+ (maybe older)

Runtime Environment:

No response

How does this issue affect you or how did you find it:

No response

Activity

  1. vfazio
    added
    00 - Bug
    on May 5, 2026
  2. charris commented on May 5, 2026

    @charris
    charris
    on May 5, 2026
    Member
    More actions

    Hmm, looks like a distutils thing. I assume you don't see this in Python versions > 3.11? Distutils is gone in the upcoming NumPy 2.4.x series.

  3. vfazio commented on May 5, 2026

    @vfazio
    vfazio
    on May 5, 2026
    Author
    More actions

    I didn't see it in any 3.12 wheels but I didn't verify all of them. I'm not familiar with numpy or why there's a distutils subfolder and how that interacts with the disutils from stdlib (and now setuptools).

  4. charris
    closed this as completedin #31397on May 7, 2026
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

    00 - Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — 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.