[Scons-users] Help needed with "Options"

Mats Wichmann mats at wichmann.us
Tue Jan 14 09:28:41 EST 2020


On 1/14/20 6:13 AM, Sophie Lagarde wrote:
> Hi,
> 
> I am using a code I did not develop by myself. It is basically a python 
> code, I am working on python 3 with anaconda. I installed the scons 
> package with anaconda, and when I am making "conda list", it does appear 
> in the list (version 3.1.2).
> 
> My problem is that when I want to run the code, scons is not happy (in 
> my SConstruct file) with the following line:
> 
> opts = Options(config)
> scons: Reading SConscript files ...
> NameError: name 'Options' is not defined
> 
> And I don't know why. My guess is that this function ("Options") existed 
> in previous version, but does not exist anymore (I found references to 
> it in SCons User Guide 0.97 and 0.98 

Yes, it was removed quite a while ago, replaced by "Variables".

You can read about the ways to collect information from the command line 
here:

https://scons.org/doc/3.1.2/HTML/scons-user.html#sect-command-line-variables

but if you're very new to Python as well, that may not be enough 
information. The User Guide is written from the viewpoint that you don't 
have to be experienced in Python, but my opinion is that mostly works if 
you read it from the beginning, further along it seems to expect a 
little more experience, so jumping right into chapter 10 may or may not 
prove helpful.

I'm new enough to scons that Options were *never* around, but I believe 
the transition from Options -> Variables was fairly gentle.

Someone here will hopefully be able to take a look at your SConstruct 
presently.  There will likely be a few other transitions as well, the 
use of Options suggests the script is quite old, and you've indicated 
you are using Python 3, which was only supported since SCons 3.x, so any 
work related to that was going to have to happen anyway.



More information about the Scons-users mailing list