gem5-users@gem5.org

The gem5 Users mailing list

View all threads

Error: Can't find a working Python installation redux

KA
Kar, Anurag Arunkumar
Wed, Mar 15, 2023 12:57 PM

Hi,

I tried following previous archived threads which said the solution to this problem was to provide the path to  PYTHON_CONFIG and not using a conda environment.

I am not using a conda environment and am providing the path in the scons command:

scons ./build/ARM_MESI_Three_Level/gem5.opt PYTHON_CONFIG=/usr/bin/python-config
scons: Reading SConscript files ...
Mkdir("/data/anurag/gem5-public/build/ARM_MESI_Three_Level/gem5.build")
Checking for linker -Wl,--as-needed support... (cached) yes
Checking for compiler -Wno-free-nonheap-object support... (cached) yes
Checking for compiler -gz support... (cached) yes
Checking for linker -gz support... (cached) yes
Info: Using Python config: python3-config
Checking for C header file Python.h... (cached) yes
Checking Python version... no
Error: Can't find a working Python installation

I have been able to build gem5 on this very machine before, I’m not sure what changed between then and now. Can someone help me debug this?

Regards,
Anurag

Hi, I tried following previous archived threads which said the solution to this problem was to provide the path to PYTHON_CONFIG and not using a conda environment. I am not using a conda environment and am providing the path in the scons command: scons ./build/ARM_MESI_Three_Level/gem5.opt PYTHON_CONFIG=/usr/bin/python-config scons: Reading SConscript files ... Mkdir("/data/anurag/gem5-public/build/ARM_MESI_Three_Level/gem5.build") Checking for linker -Wl,--as-needed support... (cached) yes Checking for compiler -Wno-free-nonheap-object support... (cached) yes Checking for compiler -gz support... (cached) yes Checking for linker -gz support... (cached) yes Info: Using Python config: python3-config Checking for C header file Python.h... (cached) yes Checking Python version... no Error: Can't find a working Python installation I have been able to build gem5 on this very machine before, I’m not sure what changed between then and now. Can someone help me debug this? Regards, Anurag
EM
Eliot Moss
Wed, Mar 15, 2023 1:18 PM

On 3/15/2023 8:57 AM, Kar, Anurag Arunkumar via gem5-users wrote:

Hi,

I tried following previous archived threads which said the solution to this problem was to provide
the path to  PYTHON_CONFIG and not using a conda environment.

I am not using a conda environment and am providing the path in the scons command:

scons ./build/ARM_MESI_Three_Level/gem5.opt PYTHON_CONFIG=/usr/bin/python-config

scons: Reading SConscript files ...

Mkdir("/data/anurag/gem5-public/build/ARM_MESI_Three_Level/gem5.build")

Checking for linker -Wl,--as-needed support... (cached) yes

Checking for compiler -Wno-free-nonheap-object support... (cached) yes

Checking for compiler -gz support... (cached) yes

Checking for linker -gz support... (cached) yes

Info: Using Python config: python3-config

Checking for C header file Python.h... (cached) yes

Checking Python version... no

Error: Can't find a working Python installation

I have been able to build gem5 on this very machine before, I’m not sure what changed between then
and now. Can someone help me debug this?

To pass an environment variable into a program, write your command line this way:

PYTHON_CONFIG=/usr/bin/python-config scons ./build/ARM_MESI_Three_Level/gem5.opt

or else do this first:

export PYTHON_CONFIG=/usr/bin/python-config

BUT ... at least in my setup, python-config does not exist, yet all works fine.

Is python accessible through PATH?  That's what I would check first.  If you're
on bash, then "type python" will show you.

Cheers - Eliot Moss

On 3/15/2023 8:57 AM, Kar, Anurag Arunkumar via gem5-users wrote: > Hi, > > I tried following previous archived threads which said the solution to this problem was to provide > the path to  PYTHON_CONFIG and not using a conda environment. > > I am not using a conda environment and am providing the path in the scons command: > > scons ./build/ARM_MESI_Three_Level/gem5.opt PYTHON_CONFIG=/usr/bin/python-config > > scons: Reading SConscript files ... > > Mkdir("/data/anurag/gem5-public/build/ARM_MESI_Three_Level/gem5.build") > > Checking for linker -Wl,--as-needed support... (cached) yes > > Checking for compiler -Wno-free-nonheap-object support... (cached) yes > > Checking for compiler -gz support... (cached) yes > > Checking for linker -gz support... (cached) yes > > Info: Using Python config: python3-config > > Checking for C header file Python.h... (cached) yes > > Checking Python version... no > > Error: Can't find a working Python installation > > I have been able to build gem5 on this very machine before, I’m not sure what changed between then > and now. Can someone help me debug this? To pass an environment variable into a program, write your command line this way: PYTHON_CONFIG=/usr/bin/python-config scons ./build/ARM_MESI_Three_Level/gem5.opt or else do this first: export PYTHON_CONFIG=/usr/bin/python-config BUT ... at least in my setup, python-config does not exist, yet all works fine. Is python accessible through PATH? That's what I would check first. If you're on bash, then "type python" will show you. Cheers - Eliot Moss
GT
Giacomo Travaglini
Wed, Mar 15, 2023 1:27 PM

Hi Anurag

On 15/03/2023 12:57, Kar, Anurag Arunkumar via gem5-users wrote:
Hi,

I tried following previous archived threads which said the solution to this problem was to provide the path to  PYTHON_CONFIG and not using a conda environment.

I am not using a conda environment and am providing the path in the scons command:

scons ./build/ARM_MESI_Three_Level/gem5.opt PYTHON_CONFIG=/usr/bin/python-config
scons: Reading SConscript files ...
Mkdir("/data/anurag/gem5-public/build/ARM_MESI_Three_Level/gem5.build")
Checking for linker -Wl,--as-needed support... (cached) yes
Checking for compiler -Wno-free-nonheap-object support... (cached) yes
Checking for compiler -gz support... (cached) yes
Checking for linker -gz support... (cached) yes
Info: Using Python config: python3-config
Checking for C header file Python.h... (cached) yes
Checking Python version... no
Error: Can't find a working Python installation

It seems like SCons is able to find the Python.h header file but it is not able to gather the python version of the interpreter for whatever reason (check CheckPythonLib). When I have these sporadic errors I usually remove the build folder and start a clean build. If the error is still present, you might want to debug CheckPythonLib with pdb.

If you don't want to do any debugging, you should consider using docker 1

Hope it helps

Giacomo

I have been able to build gem5 on this very machine before, I’m not sure what changed between then and now. Can someone help me debug this?

Regards,
Anurag


gem5-users mailing list -- gem5-users@gem5.orgmailto:gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.orgmailto:gem5-users-leave@gem5.org

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Hi Anurag On 15/03/2023 12:57, Kar, Anurag Arunkumar via gem5-users wrote: Hi, I tried following previous archived threads which said the solution to this problem was to provide the path to PYTHON_CONFIG and not using a conda environment. I am not using a conda environment and am providing the path in the scons command: scons ./build/ARM_MESI_Three_Level/gem5.opt PYTHON_CONFIG=/usr/bin/python-config scons: Reading SConscript files ... Mkdir("/data/anurag/gem5-public/build/ARM_MESI_Three_Level/gem5.build") Checking for linker -Wl,--as-needed support... (cached) yes Checking for compiler -Wno-free-nonheap-object support... (cached) yes Checking for compiler -gz support... (cached) yes Checking for linker -gz support... (cached) yes Info: Using Python config: python3-config Checking for C header file Python.h... (cached) yes Checking Python version... no Error: Can't find a working Python installation It seems like SCons is able to find the Python.h header file but it is not able to gather the python version of the interpreter for whatever reason (check CheckPythonLib). When I have these sporadic errors I usually remove the build folder and start a clean build. If the error is still present, you might want to debug CheckPythonLib with pdb. If you don't want to do any debugging, you should consider using docker [1] [1]: https://www.gem5.org/documentation/general_docs/building Hope it helps Giacomo I have been able to build gem5 on this very machine before, I’m not sure what changed between then and now. Can someone help me debug this? Regards, Anurag _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
KA
Kar, Anurag Arunkumar
Wed, Mar 15, 2023 1:38 PM

So, Eliot’s response didn’t work for me. But Giacomo’s did which is to just delete the build folder and start afresh (a bit inconvenient if I only had incremental changes over my previous build).

Before I got the responses, I tried hardcoding the python version (received by doing python –version in my terminal) into the SConstruct file, and that….worked. I’m not sure if that is the right way to go about this though.

Regards,
Anurag

From: Giacomo Travaglini giacomo.travaglini@arm.com
Date: Wednesday, March 15, 2023 at 9:28 AM
To: The gem5 Users mailing list gem5-users@gem5.org
Cc: Kar, Anurag Arunkumar akar34@gatech.edu
Subject: Re: [gem5-users] Error: Can't find a working Python installation redux

Hi Anurag
On 15/03/2023 12:57, Kar, Anurag Arunkumar via gem5-users wrote:
Hi,

I tried following previous archived threads which said the solution to this problem was to provide the path to  PYTHON_CONFIG and not using a conda environment.

I am not using a conda environment and am providing the path in the scons command:

scons ./build/ARM_MESI_Three_Level/gem5.opt PYTHON_CONFIG=/usr/bin/python-config
scons: Reading SConscript files ...
Mkdir("/data/anurag/gem5-public/build/ARM_MESI_Three_Level/gem5.build")
Checking for linker -Wl,--as-needed support... (cached) yes
Checking for compiler -Wno-free-nonheap-object support... (cached) yes
Checking for compiler -gz support... (cached) yes
Checking for linker -gz support... (cached) yes
Info: Using Python config: python3-config
Checking for C header file Python.h... (cached) yes
Checking Python version... no
Error: Can't find a working Python installation

It seems like SCons is able to find the Python.h header file but it is not able to gather the python version of the interpreter for whatever reason (check CheckPythonLib). When I have these sporadic errors I usually remove the build folder and start a clean build. If the error is still present, you might want to debug CheckPythonLib with pdb.

If you don't want to do any debugging, you should consider using docker 1

Hope it helps

Giacomo

I have been able to build gem5 on this very machine before, I’m not sure what changed between then and now. Can someone help me debug this?

Regards,
Anurag


gem5-users mailing list -- gem5-users@gem5.orgmailto:gem5-users@gem5.org

To unsubscribe send an email to gem5-users-leave@gem5.orgmailto:gem5-users-leave@gem5.org
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

So, Eliot’s response didn’t work for me. But Giacomo’s did which is to just delete the build folder and start afresh (a bit inconvenient if I only had incremental changes over my previous build). Before I got the responses, I tried hardcoding the python version (received by doing python –version in my terminal) into the SConstruct file, and that….worked. I’m not sure if that is the right way to go about this though. Regards, Anurag From: Giacomo Travaglini <giacomo.travaglini@arm.com> Date: Wednesday, March 15, 2023 at 9:28 AM To: The gem5 Users mailing list <gem5-users@gem5.org> Cc: Kar, Anurag Arunkumar <akar34@gatech.edu> Subject: Re: [gem5-users] Error: Can't find a working Python installation redux Hi Anurag On 15/03/2023 12:57, Kar, Anurag Arunkumar via gem5-users wrote: Hi, I tried following previous archived threads which said the solution to this problem was to provide the path to PYTHON_CONFIG and not using a conda environment. I am not using a conda environment and am providing the path in the scons command: scons ./build/ARM_MESI_Three_Level/gem5.opt PYTHON_CONFIG=/usr/bin/python-config scons: Reading SConscript files ... Mkdir("/data/anurag/gem5-public/build/ARM_MESI_Three_Level/gem5.build") Checking for linker -Wl,--as-needed support... (cached) yes Checking for compiler -Wno-free-nonheap-object support... (cached) yes Checking for compiler -gz support... (cached) yes Checking for linker -gz support... (cached) yes Info: Using Python config: python3-config Checking for C header file Python.h... (cached) yes Checking Python version... no Error: Can't find a working Python installation It seems like SCons is able to find the Python.h header file but it is not able to gather the python version of the interpreter for whatever reason (check CheckPythonLib). When I have these sporadic errors I usually remove the build folder and start a clean build. If the error is still present, you might want to debug CheckPythonLib with pdb. If you don't want to do any debugging, you should consider using docker [1] [1]: https://www.gem5.org/documentation/general_docs/building Hope it helps Giacomo I have been able to build gem5 on this very machine before, I’m not sure what changed between then and now. Can someone help me debug this? Regards, Anurag _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.