-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant find Python.h inside a virtualenv #1739
Comments
Here's the relevant error:
Where are the include headers stored? Would be helpful to also see |
The headers are stored at:
and the output of the JSON file is: {
"st_mtime": 1581360923.0,
"path": "/usr/bin/python2.7",
"content": {
"base_exec_prefix": null,
"system_stdlib": "/usr/lib/python2.7",
"has_venv": false,
"prefix": "/usr",
"stdout_encoding": null,
"executable": "/usr/bin/python2.7",
"implementation": "CPython",
"exec_prefix": "/usr",
"platform": "linux2",
"version": "2.7.16 (default, Feb 10 2020, 18:54:57) \n[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]",
"sysconfig_paths": {
"platstdlib": "{platbase}/lib64/python{py_version_short}",
"platlib": "{platbase}/local/lib64/python{py_version_short}/site-packages",
"purelib": "{base}/local/lib/python{py_version_short}/site-packages",
"stdlib": "{base}/lib/python{py_version_short}",
"scripts": "{base}/local/bin",
"include": "{base}/local/include/python{py_version_short}",
"data": "{base}/local"
},
"base_prefix": null,
"system_stdlib_platform": "/usr/lib64/python2.7",
"_creators": null,
"file_system_encoding": "ANSI_X3.4-1968",
"version_info": {
"major": 2,
"minor": 7,
"micro": 16,
"releaselevel": "final",
"serial": 0
},
"sysconfig_vars": {
"base": "/usr",
"platbase": "/usr",
"PYTHONFRAMEWORK": "",
"py_version_short": "2.7"
},
"path": [
"/usr/local/lib/python3.6/site-packages/virtualenv/discovery",
"/usr/lib/python27.zip",
"/usr/lib64/python2.7",
"/usr/lib64/python2.7/plat-linux2",
"/usr/lib64/python2.7/lib-tk",
"/usr/lib64/python2.7/lib-old",
"/usr/lib64/python2.7/lib-dynload",
"/usr/local/lib64/python2.7/site-packages",
"/usr/local/lib/python2.7/site-packages",
"/usr/lib64/python2.7/site-packages",
"/usr/lib/python2.7/site-packages",
"/usr/lib64/python2.7/dist-packages",
"/usr/lib/python2.7/dist-packages"
],
"max_size": 9223372036854775807,
"real_prefix": null,
"distutils_install": {
"purelib": "lib/python2.7/site-packages",
"headers": "include/python2.7/UNKNOWN",
"platlib": "lib64/python2.7/site-packages",
"data": "",
"scripts": "bin"
},
"architecture": 64,
"original_executable": "/usr/bin/python2.7",
"os": "posix",
"system_executable": "/usr/bin/python2.7"
}
} |
Then that python is just broken 😢 The interpreter tells us that it should be inside "sysconfig_paths": {
"include": "{base}/local/include/python{py_version_short}",
},
"sysconfig_vars": {
"base": "/usr",
"py_version_short": "2.7"
}, Which resolves to |
We can fall back to the distuils path to resolve this but I'd recommend opening an issue for whoever packages that Python 👍 because they're doing something wrong here 👍 |
This source of this RPM package can be found at:
On Centos8 the Python.h is located where you expected:
And an original Centos 6, the files are also as expected:
But I wasn't able to find Python27 package for Centos 6 or Centos8 |
@tzulberti where you expected is actually where the following things says:
So this might not necessarily be |
Released via https://pypi.org/project/virtualenv/20.0.13/ |
Thank you for solving the issue so fast. I tested it using the |
Issue
I try to install a package for python2 inside a virtualenv and the compilation fails mentioning that it can't find Python.h.
But, if I install the same package at the system level it can find that issue
I tested this with the lastest virutalenv release (20.0.12)
Environment
You can tests the build using this Dockerfile
And the error when building that dockerfile is:
Output of the virtual environment creation
Make sure to run the creation with
-vvv --with-traceback
:Thank you for the amazing work
The text was updated successfully, but these errors were encountered: