Skip to content
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

fatal error: 'pyconfig.h' file not found #1505

Closed
prateektiwari7 opened this issue Dec 28, 2018 · 10 comments
Closed

fatal error: 'pyconfig.h' file not found #1505

prateektiwari7 opened this issue Dec 28, 2018 · 10 comments
Assignees
Milestone

Comments

@prateektiwari7
Copy link

prateektiwari7 commented Dec 28, 2018

Hi Team,

I am facing issue while building the nano blockchain.

Steps: What I did?

  1. Clone the nano git and start the building process by using the command $sudo sh bootstrap_boost.sh
  2. I already installed the boots for mac Error I am facing while building as

`In file included from libs/python/src/list.cpp:5:
In file included from ./boost/python/list.hpp:8:
In file included from ./boost/python/detail/prefix.hpp:13:
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found
include <pyconfig.h>
^
1 error generated.
In file included from libs/python/src/long.cpp:5:
In file included from ./boost/python/long.hpp:8:
In file included from ./boost/python/detail/prefix.hpp:13:
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found
include <pyconfig.h>
^
1 error generated.
In file included from libs/python/src/dict.cpp:4:
In file included from ./boost/python/dict.hpp:8:
In file included from ./boost/python/detail/prefix.hpp:13:
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found
include <pyconfig.h>
^
1 error generated.
In file included from libs/python/src/tuple.cpp:5:
In file included from ./boost/python/tuple.hpp:8:
In file included from ./boost/python/detail/prefix.hpp:13:
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found
include <pyconfig.h>
^
1 error generated.
In file included from libs/python/src/str.cpp:4:
In file included from ./boost/python/str.hpp:8:
In file included from ./boost/python/detail/prefix.hpp:13:
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found
include <pyconfig.h>
^
1 error generated.
In file included from libs/python/src/slice.cpp:1:
In file included from ./boost/python/slice.hpp:9:
In file included from ./boost/python/detail/prefix.hpp:13:
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found
include <pyconfig.h>
^
1 error generated.
In file included from libs/python/src/converter/from_python.cpp:6:
In file included from ./boost/python/converter/from_python.hpp:8:
In file included from ./boost/python/detail/prefix.hpp:13:
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found

include <pyconfig.h>
^
1 error generated.
In file included from libs/python/src/converter/registry.cpp:5:
In file included from ./boost/python/converter/registry.hpp:7:
In file included from ./boost/python/type_id.hpp:8:
In file included from ./boost/python/detail/prefix.hpp:13:
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found
include <pyconfig.h>
^
`

I checked this command in my terminal to solve this issue as $export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/include/python2.7/"

I also added the file path in my bash_profile
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/include/python2.7/

And python 2.7 lib path to check whether file 'pyconfig.h' is present and it is present.
/usr/include/python2.7
fileobject.h pycapsule.h unicodeobject.h floatobject.h pyconfig.h warnings.h frameobject.h pyctype.h

Current python version
$ python --version Python 3.7.0

Please help me to solve this error thank you

@prateektiwari7
Copy link
Author

Hi @zhyatt

Can you please help me to find out the solution of above Query

@prateektiwari7
Copy link
Author

Hi @argakiig

I think you didn't answer that, dont make this in the loop. I check the issue there in #1519 which make me again redirect to #1505.

Please solve the issue atleast at one position

@zhyatt
Copy link
Collaborator

zhyatt commented Dec 31, 2018

@prateektiwari7 There is an issue with your python setup preventing boost from identifying the correct location. I would double-check your path includes proper location (you indicate two different versions of python in your issue), source the file in your terminal and try again.

@clemahieu
Copy link
Contributor

clemahieu commented Dec 31, 2018

This looks related to boost python and/or your python environment. I did a search and other people have had this issue on other projects. One place is here. boostorg/python#187

@prateektiwari7
Copy link
Author

prateektiwari7 commented Dec 31, 2018

Hi @zhyatt

Yes. I also tried for 3.7 with reference as export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:path to python 3.7"

same issue :)

@clemahieu
Copy link
Contributor

Since this is a boost/python related issue you'll get better assistance with them since we've never run in to this problem internally.

@zhyatt
Copy link
Collaborator

zhyatt commented Dec 31, 2018

Closing out as external issue with https://github.com/boostorg/boost/issues and python

@zhyatt zhyatt closed this as completed Dec 31, 2018
@prateektiwari7
Copy link
Author

Hi @zhyatt

I solved this issue by finding my pyconfig.h from the command
$python3.7-config --includes --libs

Than export the python lib in ~/.bashrc_profile
nano ~/.bashrc_profile

export
CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/Users/yudiz/anaconda3/include/python3.7m"

After this source ~/.bashrc_profile

After this the Error solved :)

@rajhlinux
Copy link

Tried the answer from: prateektiwari7

Did not work for me on FreeBSD 13.1:

/usr/local/include/boost/python/detail/wrap_python.hpp:57:11: fatal error: 'pyconfig.h' file not found
# include <pyconfig.h>

@dsiganos
Copy link
Contributor

dsiganos commented Sep 29, 2022

You do not need to build python support into the boost library, we are not using python features.
Provide this when building nano:

./bootstrap.sh --without-libraries=python

for more details on how to build boost, see:
https://github.com/dsiganos/nano-workspace/blob/main/boost/Makefile

For an automatic way to build nano:
https://github.com/dsiganos/nano-workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants