9

this is my first question here and also my first touch with scons. I ran a build from source using the command "sudo python setup.py install --symlink-scons --standard-lib". It seemed to build without errors but failed as follows:

$ scons --version Import failed. Unable to find SCons files in: /usr/local/bin/../engine /usr/local/bin/scons-local-2.3.2 /usr/local/bin/scons-local /usr/local/lib/scons-2.3.2 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.2 /usr/local/lib/python2.7/site-packages/scons-2.3.2 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scons-2.3.2 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.2 /usr/local/lib/scons /System/Library/Frameworks/Python.framework/Versions/2.7/lib/scons /usr/local/lib/python2.7/site-packages/scons /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scons /System/Library/Frameworks/Python.framework/Versions/2.7/lib/scons Traceback (most recent call last): File "/usr/local/bin/scons", line 190, in <module> import SCons.Script ImportError: No module named SCons.Script 

Python version is 2.7.5; running on OS X Mavericks 10.9.4. No file starting with "SCons.Script" is anywhere on the system.

Thanks for your help.

4
  • Can you be a bit more specific about "I ran a build from source"? Are you trying to install it from a clone of the development repository, or did you download und unpack the source tarball? The installation process should actually tell you into which folder the files get installed. Finally, the module name "SCons.Script" refers to a file named "__init__.py" in the package folder "SCons/Script"...so you might want to search for "SCons/Script/__init__.py". Commented Jul 22, 2014 at 23:03
  • Yes, downloaded the source tarball and built it using the command stated above. Knowing nothing about python, I naively assumed "The file name is the module name with the suffix .py appended" link. However, after much research and investigation, it appears that the installation instructions are incorrect. The scons library is not under any of the above paths but under /usr/local/lib/SCons (note case). By adding the latter path to PYTHONHOME, scons now works. Thanks for responding and clarifying modules & files! Commented Jul 23, 2014 at 5:09
  • It would be awesome if you could post your findings to the User mailing list of SCons at "[email protected]". Your contribution could really help us to improve things for the Mac world. We're always looking for testers, that can provide some feedback...so you'd be more than welcome. Commented Jul 23, 2014 at 7:05
  • A couple notes: 1) looks like you're not using the standard python, nor mac ports python. 2) when I run the above install commands in a virtualenv I run into no problems. (at least with 2.4.0) Can you retry with 2.4.0? Commented Sep 22, 2015 at 0:25

3 Answers 3

4

For me - OS X (darwin) the following has just worked (after wasting days on this problem):

Once scons is installed and not working:

Print python import paths from a python console:

$python >>import sys >>print sys.path 

Look for the path that ends up with "site-packages". cd there and look for the dir that starts with scons. You shall see at least one dir that looks like this "sons-x.y.z" (version).

cd back to site-packages.

mkdir SCons 

Make sure it's empty.

Now copy everything from the original SCons dir to the new one (modify the following line as needed:)

cp -R scons-x.y.z/SCons/ SCons/ 
Sign up to request clarification or add additional context in comments.

Comments

0

It appears that LIBPATH is used by scons to locate libraries, so is probably preferable to PYTHONHOME mentioned above.

Comments

0

I fixed this using conda and brew uninstall scons

conda activate conda install scons scons 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.