PlatformIO Community

`Import("env")` On a script called by a script

Hi,

I’m working on a lib and I use pre extraScript features. On this script I select the good HAL allowing it to compile for the good target.
Lib users should be able to develop their own HAL easily by adding a folder.
But I have some specific HAL that needs some additional scripting operations. In this case I would like to call this additional script from the HAL folder on the pre_extraScript.

I’m importing this specific script but the Import("env") line create an error :
NameError: name 'Import' is not defined:

I’m not a good python dev, Do you have any insight about it?

Hi @nicolas_luos ,

How do you call that SCons-based script? You have to use

env.SConscript("path/to/script", exports="env")
1 Like

That’s it! thank you @ivankravets

1 Like