Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Adapt python3-config to produce correct output in a virtual environment

オープン
#515 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python, shell
領域
tooling

調査の方向性

Start by reproducing the pyenv virtualenv, pyenv activate, and python3-config --includes commands from the issue, then trace how the virtual environment's include directory and python3-config output are created. Done means a newly created environment provides valid Python headers and python3-config --includes no longer points to an empty or duplicated include path.

索引モデルが issue の本文から書いたものです。

説明

Related to https://github.com/pyenv/pyenv-virtualenv/issues/462

Steps to reproduce

  1. Create a new virtualenv and activate it:
$ pyenv virtualenv 3.12.11 test
$ pyenv activate test
  1. Check that python3-config points to pyenv's shim
$ which python3-config
/home/ali/.pyenv/shims/python3-config
  1. Check where python3-config include directories are (same directory is listed twice for some reason?):
$ python3-config --includes
-I/home/ali/.pyenv/versions/3.12.11/envs/test/include/python3.12 -I/home/ali/.pyenv/versions/3.12.11/envs/test/include/python3.12
  1. Check what's in that directory (nothing)
ls -al /home/ali/.pyenv/versions/3.12.11/envs/test/include/python3.12
total 8
drwxr-xr-x 2 ali ali 4096 Aug 28 10:53 .
drwxr-xr-x 3 ali ali 4096 Aug 28 10:53 ..

Thus, whenever I try to compile something that needs to use python headers, I get the following error:

libsplinemodule.c:18:10: fatal error: Python.h: No such file or directory
   18 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.

I can get around this by linking the virtualenv include directory to the original pyenv include directory:

$ rm -rf /home/ali/.pyenv/versions/3.12.11/envs/test/include
$ ln -s /home/ali/.pyenv/versions/3.12.11/include /home/ali/.pyenv/versions/3.12.11/envs/test/include

Presumably pyenv-virtualenv should do something like this by default when you create the environment?

主要言語
Shell
スター
6.7k
フォーク
427
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pyenv/pyenv-virtualenv のほかの issue

pyenv/pyenv-virtualenv の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。