[Scons-users] conflict with scons.bat 3.0.0 and anaconda3
Bill Deegan
bill at baddogconsulting.com
Tue Dec 5 23:23:01 EST 2017
It would really be contrary to SCons policy to accept a change when we
don't understand
a) why the existing file is broken
b) Why the change fixes it.
Are the conda folks any help in understanding either?
On Tue, Dec 5, 2017 at 8:19 PM, Toby, Brian H. <toby at anl.gov> wrote:
> All I can tell you is that when I run C:\conda3-64\Scripts\scons.bat then
> %~dp0.. puts C:\conda3-64\Scripts\.. into the path, which should be OK but
> somehow is breaking Python (even though C:\conda3-64 is already in the
> path).
>
> While this command
>
> for %%i in ("%~dp0..") do set "folder=%%~fi"
>
> sets variable folder to a cleaned version of that path, C:\conda3-64.
> Adding that to the path (for the 2nd time) does not cause any problems.
> Exactly how that command works, I do not understand either. I am not a
> great fan of bash (or any of the other unix shells) but cmd.exe makes even
> bash look good.
>
> Brian
>
> On Dec 5, 2017, at 10:12 PM, Bill Deegan <bill at baddogconsulting.com>
> wrote:
>
> Can you explain what this change does?
> MY windows cmd shell foo is not over strong..
>
> On Tue, Dec 5, 2017 at 7:04 PM, Toby, Brian H. <toby at anl.gov> wrote:
>
>> Bill,
>>
>> I have a fix to propose for scons.bat. If I crib some code that generates
>> the parent directory (through some sort of DOS magic) for where the script
>> is located and use that in the path, I no longer have the problem with
>> Python crashing on startup.
>>
>> The change is to replace this line:
>>
>> set path=%~dp0;%~dp0..;%path%
>>
>>
>> with these two:
>>
>> for %%i in ("%~dp0..") do set "folder=%%~fi"
>> set path=%~dp0;%folder%;%path%
>>
>>
>> Brian
>>
>> On Dec 4, 2017, at 5:32 PM, Toby, Brian H. <toby at anl.gov> wrote:
>>
>> I see where you are going, but I am not sure why this path works:
>>
>> C:\conda3-64\Scripts\;C:\conda3-64;C:\conda3-64;C:\conda3-
>> 64\Library\mingw-w64\bin;C:\conda3-64\Library\usr\bin;C:\
>> conda3-64\Library\bin;C:\conda3-64\Scripts;C:\Program Files
>> (x86)\Parallels\Parallels Tools\Applications;C:\ProgramD
>> ata\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:
>> \windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\
>> Users\toby.WIN10-VM\AppData\Local\Microsoft\WindowsApps
>>
>> and this does not "C:\conda3-64\Scripts\;C:\conda3-64\..;C:\conda3-64;…"?
>>
>> In any case, there are no DLLs in \conda2-32\Scripts\
>>
>> Brian
>>
>> (root) C:\Users\toby.WIN10-VM>dir /b \conda2-32\Scripts\
>> 2to3-script.py
>> 2to3.exe
>> activate
>> activate.bat
>> chardetect-script.py
>> chardetect.exe
>> chardetect.exe.manifest
>> conda-env-script.py
>> conda-env.exe
>> conda-script.py
>> conda.exe
>> deactivate
>> deactivate.bat
>> easy_install-2.7-script.py
>> easy_install-2.7.exe
>> easy_install-2.7.exe.manifest
>> easy_install-script.py
>> easy_install.exe
>> easy_install.exe.manifest
>> f2py.bat
>> f2py.py
>> idle-script.py
>> idle.exe
>> menuinst-script.py
>> menuinst.exe
>> pip-script.py
>> pip.exe
>> pydoc-script.py
>> pydoc.exe
>> pywin32_postinstall.py
>> pywin32_testall.py
>> scons-3.0.0.bat
>> scons-3.0.0.py
>> scons-configure-cache-3.0.0.py
>> scons-configure-cache.py
>> scons-time-3.0.0.py
>> scons-time.py
>> scons.bat
>> scons.py
>> sconsign-3.0.0.py
>> sconsign.py
>> wheel-script.py
>> wheel.exe
>> wheel.exe.manifest
>>
>>
>> On Dec 4, 2017, at 5:17 PM, Bill Deegan <bill at baddogconsulting.com>
>> wrote:
>>
>> Is there a dll named encodings somewhere in your path? (mabye
>> c:|conda3-64\Scripts"?
>> Or can you paste a listing of the files in Scripts?
>> Seems likely it's picking up something from there that it shouldn't..
>>
>>
>> On Mon, Dec 4, 2017 at 3:11 PM, Toby, Brian H. <toby at anl.gov> wrote:
>>
>>> Bill (et al),
>>>
>>> Yes I am running Win10 (as a VM in parallels). I have lots of test
>>> Pythons installed, all via miniconda, but none in the path by default. I
>>> use <path>\Scripts\activate to use the one I want. I am only using the root
>>> environment for each install, FWIW.
>>>
>>> The one in question here is the latest miniconda3, with "conda update
>>> —all" followed by "conda install scons numpy m2w64-gcc-fortran”
>>>
>>> The initial path is
>>>
>>> C:\conda3-64;C:\conda3-64\Library\mingw-w64\bin;C:\conda3-64
>>> \Library\usr\bin;C:\conda3-64\Library\bin;C:\conda3-64\Scripts;C:\Program
>>> Files (x86)\Parallels\Parallels Tools\Applications;C:\ProgramD
>>> ata\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\
>>> windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\
>>> v1.0\;C:\Users\toby.WIN10-VM\AppData\Local\Microsoft\WindowsApps
>>>
>>>
>>> and echo %~dp0 gives C:\conda3-64\Scripts\
>>>
>>> After the set path=%~dp0;%~dp0..;%path% command the path is now
>>>
>>> C:\conda3-64\Scripts\;C:\conda3-64\Scripts\..;C:\conda3-64;C
>>> :\conda3-64\Library\mingw-w64\bin;C:\conda3-64\Library\usr\
>>> bin;C:\conda3-64\Library\bin;C:\conda3-64\Scripts;C:\Program Files
>>> (x86)\Parallels\Parallels Tools\Applications;C:\ProgramD
>>> ata\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\
>>> windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\
>>> v1.0\;C:\Users\toby.WIN10-VM\AppData\Local\Microsoft\WindowsApps
>>>
>>>
>>> For reasons unclear to me with this path, Python fails to start with
>>> error:
>>>
>>> Fatal Python error: Py_Initialize: unable to load the file system codec
>>> ModuleNotFoundError: No module named 'encodings'
>>>
>>>
>>> If I change the path to so the second entry is C:\conda3-64, rather than
>>> C:\conda3-64\Scripts\.. this error goes away.
>>>
>>> Brian
>>>
>>> On Dec 4, 2017, at 1:25 PM, Bill Deegan <bill at baddogconsulting.com>
>>> wrote:
>>>
>>> Can you echo out the path and paste here?
>>> Also echo %~dp0
>>>
>>> Haven't seen this issue before.
>>> Which versions of python do you have installed on your system?
>>> Also what OS? (Looks like win10)
>>>
>>>
>>> On Mon, Dec 4, 2017 at 10:15 AM, Toby, Brian H. <toby at anl.gov> wrote:
>>>
>>>> Sorry if I am posting about a known/fixed issue, but I have recently
>>>> started work with Python 3. I have noticed that on windows the scons.bat
>>>> file fails (though if scons.py is invoked directly it works fine).
>>>>
>>>> (root) C:\Users\toby.WIN10-VM\Documents\fsource>scons
>>>> Fatal Python error: Py_Initialize: unable to load the file system codec
>>>> ModuleNotFoundError: No module named 'encodings'
>>>>
>>>>
>>>> The problem is related to prepending to the path:
>>>>
>>>> @REM ensure the script will be executed with the Python it was
>>>> installed for
>>>> set path=%~dp0;%~dp0..;%path%
>>>>
>>>>
>>>> where appending seems to avoid the problem
>>>>
>>>> set path=%path%;%~dp0;%~dp0..
>>>>
>>>>
>>>> but I tend to think this is not the right solution. If this has been
>>>> addressed in a new scons release it would be good to push the Anaconda
>>>> folks to update.
>>>>
>>>> C:\Users\toby.WIN10-VM>\conda3-64\Scripts\activate
>>>>
>>>> (root) C:\Users\toby.WIN10-VM>conda list scons
>>>> # packages in environment at C:\conda3-64:
>>>> #
>>>> scons 3.0.0 py36hb42adb4_0
>>>>
>>>>
>>>> Brian
>>>>
>>>>
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
>
> _______________________________________________
> 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/20171205/8b0233d0/attachment.html>
More information about the Scons-users
mailing list