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

Missing pyconfig.h raises unnesseccary error #1539

Closed
Pixdigit opened this Issue Sep 27, 2015 · 12 comments

Comments

Projects
None yet
4 participants
@Pixdigit

Pixdigit commented Sep 27, 2015

While "compiling" a python file on Ubuntu studio 14.10 with Pyinstaller 3.0.dev6 and the --onedir tag it raises the error:
PyInstaller.compat.FileNotFoundError: Path or glob "/usr/include/python2.7/pyconfig.h" not found or matches no files.
Simply creating an emtpy pyconfig.h solved the problem.

@matysek

This comment has been minimized.

Member

matysek commented Sep 27, 2015

@Pixdigit is your issue solved by installing package python-dev?

@Pixdigit

This comment has been minimized.

Pixdigit commented Sep 28, 2015

@matysek Well as stated in the original message I created an empty pyconfig.h . After that everything worked fine so I imagine that somewhere in the code only a check needs to be done weather this file exists and if not it creates an empty file. But should I still try deleting pyconfig.h, install python-dev and then check if a pyconfig.h is present?

@matysek

This comment has been minimized.

Member

matysek commented Sep 28, 2015

@Pixdigit yes, please try that.

@Pixdigit

This comment has been minimized.

Pixdigit commented Sep 28, 2015

@matysek Installing python.dev solved the problem too. But this should not be necessary because even with no information in pyconfig.h the processing still work fine. Because I am not one of the makers of Pyinstaller I don't know if it uses a fallback if pyconfig.h is empty. In this case it would be ok for this error to occur but instead it should print a warning and create an empty pyconfig.h .

@htgoebel

This comment has been minimized.

Member

htgoebel commented Sep 28, 2015

Processing (freezing) your application may work. But obviously your app is including on of the packages requiring pyconfig.h. E.g. sysconfig, distutils or numpy. And some function in there require pyconfig.h.

@Pixdigit

This comment has been minimized.

Pixdigit commented Sep 28, 2015

@htgoebel Indeed it might work too. The problem is not that its not working. Its just that I think that the error has no need to be risen. Maybe a warning but not an error. For the argumentation look at my answer to @matysek above. But I also might be completely wrong.

@ghost

This comment has been minimized.

ghost commented Jan 19, 2017

Hi there, I have exactly the same problem but I installed python3.4-dev and libpython3.4-dev with no success...
I'm in a virtual environment (in order to be able to use py3.4 without modifying my system) and it seems to be the problem...

EDIT: create an empty python.h in the folder does the trick and the compilation passes...

@htgoebel

This comment has been minimized.

Member

htgoebel commented Dec 2, 2017

Which package of your Linux distribution includes the file /usr/include/python2.7/pyconfig.h? This is the one you need to install.

@Pixdigit

This comment has been minimized.

Pixdigit commented Dec 4, 2017

I'm sorry. It has been two years and I have no idea what where or how. I am neither using 14.10 nor UbuntuStudio anymore. So I can not help you. Consider this either closed or postponed.

@htgoebel htgoebel closed this Dec 5, 2017

@htgoebel htgoebel added not enough info and removed need info labels Dec 5, 2017

@mishaturnbull

This comment has been minimized.

Contributor

mishaturnbull commented Feb 26, 2018

I got this issue just barely. Running Linux Mint, using a Makefile, I got the following output:

pyinstaller -F -y -n PySpeedTest_v0.5.0_unix --specpath build --clean -c   src/gui.py
17 INFO: PyInstaller: 3.3.1
18 INFO: Python: 2.7.12
18 INFO: Platform: Linux-4.8.0-53-generic-x86_64-with-LinuxMint-18.2-sonya
21 INFO: wrote build/PySpeedTest_v0.5.0_unix.spec
24 INFO: UPX is not available.
25 INFO: Removing temporary files and cleaning cache in /home/misha/.cache/pyinstaller
33 INFO: Extending PYTHONPATH with paths
['/mnt/hgfs/PySpeedMonitor/src', '/mnt/hgfs/PySpeedMonitor/build']
35 INFO: checking Analysis
38 INFO: Building Analysis because out00-Analysis.toc is non existent
40 INFO: Initializing module dependency graph...
59 INFO: Initializing module graph hooks...
171 INFO: running Analysis out00-Analysis.toc
215 INFO: Caching module hooks...
234 INFO: Analyzing src/gui.py
2963 INFO: Processing pre-safe import module hook   _xmlplus
3209 INFO: Processing pre-find module path hook   distutils
4146 INFO: Loading module hooks...
4146 INFO: Loading module hook "hook-distutils.py"...
Unable to find "/usr/include/python2.7/pyconfig.h" when adding binary and data files.
Makefile:55: recipe for target 'main' failed
make: *** [main] Error 1

I was able to solve the error by installing the python-dev package. Not actually a problem for me, since I was able to solve it, but just wanted to give you guys more information. Hope this helps!

Info:
uname -a: Linux xxxxx-mintvm 4.8.0-53-generic #56~16.04.1-Ubuntu SMP Tue May 16 01:18:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Linux Mint VM running on Windows 10 host. x64 bit architecture.

@htgoebel

This comment has been minimized.

Member

htgoebel commented Feb 27, 2018

Hmm, we could add a hint in this case, like we do in https://github.com/pyinstaller/pyinstaller/blob/v3.3.1/PyInstaller/building/build_main.py#L620

We'd appreciate a pull-request.

@mishaturnbull

This comment has been minimized.

Contributor

mishaturnbull commented Feb 28, 2018

Pull request opened!
#3348

Hope this helps.

p.s. I'm still kinda new to working with large repos on GitHub -- if I've done something wrong please let me know.

htgoebel added a commit that referenced this issue Mar 12, 2018

building: util: Hint users to install necessary development packages ...
... if in format_binaries_and_datas() the fil not found is pyconfig.h.

See #1539.

cowo78 pushed a commit to cowo78/pyinstaller that referenced this issue Dec 7, 2018

building: util: Hint users to install necessary development packages ...
... if in format_binaries_and_datas() the fil not found is pyconfig.h.

See pyinstaller#1539.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment