[Scons-users] conflict with scons.bat 3.0.0 and anaconda3

Toby, Brian H. toby at anl.gov
Mon Dec 4 18:11:04 EST 2017


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:\ProgramData\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:\ProgramData\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<mailto: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<mailto: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<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users


_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto: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/20171204/548d66ac/attachment.html>


More information about the Scons-users mailing list