Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#515 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python, shell
Área
tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?

Lenguaje dominante
Shell
Estrellas
6.7k
Forks
427
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pyenv/pyenv-virtualenv

Todos los issues de pyenv/pyenv-virtualenv

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.