[Scons-users] "pip install scons" result in a broken installation that is unusable

Bill Deegan bill at baddogconsulting.com
Thu Oct 11 12:19:43 EDT 2018


It should work with recent pip.
Let me take a look today.
-Bill

On Thu, Oct 11, 2018 at 6:26 AM Mats Wichmann <mats at wichmann.us> wrote:

> On October 11, 2018 3:03:41 AM MDT, "Fux Samuel (ID SIS)" <
> samuel.fux at id.ethz.ch> wrote:
>>
>> Hi Bill,
>>
>> Thank you for your reply. I updated pip, but scons is still broken:
>>
>> [sfux at lo-login-02 ~]$ pip install --upgrade pip
>> Collecting pip
>>   Downloading
>> https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
>> (1.3MB)
>>     100% |████████████████████████████████| 1.3MB 763kB/s
>> Installing collected packages: pip
>>   Found existing installation: pip 9.0.3
>>     Uninstalling pip-9.0.3:
>>       Successfully uninstalled pip-9.0.3
>> Successfully installed pip-18.1
>> [sfux at lo-login-02 ~]$ pip install scons
>> Collecting scons
>> Installing collected packages: scons
>> Successfully installed scons-3.0.1
>> [sfux at lo-login-02 ~]$ scons
>> SCons import failed. Unable to find engine files in:
>>   /cluster/apps/python/2.7.14_cpu/bin/../engine
>>   /cluster/apps/python/2.7.14_cpu/bin/scons-local-3.0.1
>>   /cluster/apps/python/2.7.14_cpu/bin/scons-local
>>
>> /cluster/apps/python/2.7.14_cpu/lib64/python2.7/site-packages/lib/scons-3.0.1
>>   /cluster/apps/python/2.7.14_cpu/lib/scons-3.0.1
>>   /cluster/apps/python/2.7.14_cpu/lib/scons-3.0.1
>>
>> /cluster/apps/python/2.7.14_cpu/lib64/python2.7/site-packages/lib/python2.7/site-packages/scons-3.0.1
>>   /cluster/apps/python/2.7.14_cpu/lib/python2.7/site-packages/scons-3.0.1
>>   /cluster/apps/python/2.7.14_cpu/lib/python2.7/site-packages/scons-3.0.1
>>   /cluster/apps/python/2.7.14_cpu/lib64/scons-3.0.1
>>   /cluster/apps/python/2.7.14_cpu/lib64/python2.7/site-packages/lib/scons
>>   /cluster/apps/python/2.7.14_cpu/lib/scons
>>   /cluster/apps/python/2.7.14_cpu/lib/scons
>>
>> /cluster/apps/python/2.7.14_cpu/lib64/python2.7/site-packages/lib/python2.7/site-packages/scons
>>   /cluster/apps/python/2.7.14_cpu/lib/python2.7/site-packages/scons
>>   /cluster/apps/python/2.7.14_cpu/lib/python2.7/site-packages/scons
>>   /cluster/apps/python/2.7.14_cpu/lib64/scons
>> Traceback (most recent call last):
>>   File "/cluster/apps/python/2.7.14_cpu/bin/scons", line 192, in <module>
>>     import SCons.Script
>> ImportError: No module named SCons.Script
>> [sfux at lo-login-02 ~]$
>>
>> The following workaround fixes the problem
>>
>> export
>> SCONS_LIB_DIR=/cluster/apps/python/2.7.14_cpu/lib64/python2.7/site-packages/scons-3.0.1
>>
>> This is not my preferred solution as I would like to avoid setting
>> environment variables for all users that use Python on our hpc cluster if
>> it is only required for Scons.
>>
>> The issues arises from line 157 in
>> /cluster/apps/python/2.7.14_cpu/bin/scons:
>>
>>     temp = [os.path.join(x, 'lib') for x in prefs]
>>
>> Because of adding "lib", to the guess for the path of the scons files,
>> scons searches in
>>
>>
>> /cluster/apps/python/2.7.14_cpu/lib64/python2.7/site-packages/lib/scons-3.0.1
>>
>> instead of
>>
>> /cluster/apps/python/2.7.14_cpu/lib64/python2.7/site-packages/scons-3.0.1
>>
>> After changing
>>
>>    temp = [os.path.join(x, 'lib') for x in prefs]
>>
>> to
>>
>>    temp = [os.path.join(x, '') for x in prefs]
>>
>> scons does not show this error any more:
>>
>> [sfux at lo-login-02 bin]$ scons
>>
>> scons: *** No SConstruct file found.
>> File
>> "/cluster/apps/python/2.7.14_cpu/lib64/python2.7/site-packages/scons-3.0.1/SCons/Script/Main.py",
>> line 924, in _main
>> [sfux at lo-login-02 bin]$
>>
>> I will use this workaround as it avoids setting environment variables. It
>> is clear to me, that this only fixes the problem on our system, and maybe
>> for other sites there is a different solution required.
>>
>> Would it make sense to open an issue on github to share my findings, as
>> it seems that many people are facing this problem ?
>>
>>    - https://github.com/FPGAwars/apio/issues/143
>>    - https://github.com/Homebrew/legacy-homebrew/issues/5794
>>    -
>>    https://stackoverflow.com/questions/24897687/import-failed-unable-to-find-scons-files-import-scons-script
>>    -
>>    https://stackoverflow.com/questions/24897687/import-failed-unable-to-find-scons-files-import-scons-script/32540784
>>    -
>>    http://scons.1086193.n5.nabble.com/SCons-can-t-correctly-install-via-pip-when-not-in-a-virtualenv-td42715.html
>>    -
>>    https://pairlist4.pair.net/pipermail/scons-users/2017-December/006589.html
>>
>> Best regards
>>
>> Sam
>>
>> --
>> ETH Zurich, Dr. sc. ETH Samuel Fux
>> High Performance Computing, Scientific IT Services
>> WEC D 13, Weinbergstrasse 11, 8092 Zurich, Switzerland
>> Phone +41 44 632 57 63, http://www.id.ethz.ch/
>> samuel.fux at id.ethz.ch
>> ------------------------------
>> *Von:* Scons-users [scons-users-bounces at scons.org]" im Auftrag von "Bill
>> Deegan [bill at baddogconsulting.com]
>> *Gesendet:* Mittwoch, 10. Oktober 2018 18:42
>> *An:* SCons users mailing list
>> *Betreff:* Re: [Scons-users] "pip install scons" result in a broken
>> installation that is unusable
>>
>> Sam,
>>
>> Try:
>>
>> # update your pip and wheel package there have been significant changes
>> since py 2.7.14
>> pip install -U pip wheel
>> Then retry installing scons.
>>
>> -Bill
>>
>> On Wed, Oct 10, 2018 at 3:53 AM Fux Samuel (ID SIS) <
>> samuel.fux at id.ethz.ch> wrote:
>>
>>> Hi,
>>>
>>> I installed scons 3.0.1 with the command
>>>
>>> pip install scons
>>>
>>> on our hpc cluster, using Python 2.7.14. The installation seems to be
>>> pretty broken:
>>>
>>> [sfux at lo-login-02 ~]$ *pip install scons*
>>> Collecting scons
>>> Installing collected packages: scons
>>> Successfully installed scons-3.0.1
>>> You are using pip version 9.0.3, however version 18.1 is available.
>>> You should consider upgrading via the 'pip install --upgrade pip'
>>> command.
>>> [sfux at lo-login-02 ~]$ *scons*
>>> SCons import failed. Unable to find engine files in:
>>>   /cluster/apps/python/2.7.14/bin/../engine
>>>   /cluster/apps/python/2.7.14/bin/scons-local-3.0.1
>>>   /cluster/apps/python/2.7.14/bin/scons-local
>>>
>>> /cluster/apps/python/2.7.14/lib64/python2.7/site-packages/lib/scons-3.0.1
>>>   /cluster/apps/python/2.7.14/lib/scons-3.0.1
>>>   /cluster/apps/python/2.7.14/lib/scons-3.0.1
>>>
>>> /cluster/apps/python/2.7.14/lib64/python2.7/site-packages/lib/python2.7/site-packages/scons-3.0.1
>>>   /cluster/apps/python/2.7.14/lib/python2.7/site-packages/scons-3.0.1
>>>   /cluster/apps/python/2.7.14/lib/python2.7/site-packages/scons-3.0.1
>>>   /cluster/apps/python/2.7.14/lib64/scons-3.0.1
>>>   /cluster/apps/python/2.7.14/lib64/python2.7/site-packages/lib/scons
>>>   /cluster/apps/python/2.7.14/lib/scons
>>>   /cluster/apps/python/2.7.14/lib/scons
>>>
>>> /cluster/apps/python/2.7.14/lib64/python2.7/site-packages/lib/python2.7/site-packages/scons
>>>   /cluster/apps/python/2.7.14/lib/python2.7/site-packages/scons
>>>   /cluster/apps/python/2.7.14/lib/python2.7/site-packages/scons
>>>   /cluster/apps/python/2.7.14/lib64/scons
>>> Traceback (most recent call last):
>>>   File "/cluster/apps/python/2.7.14/bin/scons", line 192, in <module>
>>>     import SCons.Script
>>> ImportError: No module named SCons.Script
>>> [sfux at lo-login-02 ~]$ *which python*
>>> /cluster/apps/python/2.7.14/bin/python
>>> [sfux at lo-login-02 ~]$ *which pip*
>>> /cluster/apps/python/2.7.14/bin/pip
>>> [sfux at lo-login-02 ~]$ *cat /etc/redhat-release *
>>> CentOS Linux release 7.5.1804 (Core)
>>> [sfux at lo-login-02 ~]$
>>>
>>> Is this a known problem ?
>>>
>>> Can scons be installed with pip without using a virtualenv ?
>>>
>>> Best regards
>>>
>>> Sam
>>>
>>> --
>>> ETH Zurich, Dr. sc. ETH Samuel Fux
>>> High Performance Computing, Scientific IT Services
>>> WEC D 13, Weinbergstrasse 11, 8092 Zurich, Switzerland
>>> Phone +41 44 632 57 63, http://www.id.ethz.ch/
>>> samuel.fux at id.ethz.ch
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>
> there's some dodgy logic in how "prefs" is built up... e.g. look at the
> 7th item in the list of places it tried. and I see for win32, the
> expectation is you only need to look in C:\python*, though that is no
> longer the default location for Python 3 since 3.5. this should get some
> cleanup, so I'd say there's plenty of justification for filing an issue.
>
>
> --
> Sent from a mobile device with K-9 Mail. Please excuse my brevity.
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20181011/39b967f1/attachment.html>


More information about the Scons-users mailing list