Issue254

Title Windows: Anaconda Python and MinGW do not work together
Priority bug Status resolved
Superseder Nosy List kayhayen
Assigned To kayhayen Keywords windows

Created on 2015-10-13.12:27:31 by phoriwan, last changed by kayhayen.

Messages
msg1672 (view) Author: phoriwan Date: 2015-10-28.12:01:44
Thanks very much for considering my issue. I installed the latest 0.5.16pre2
version and now get an UnicodeDecodeError. At least the error message doesn't
seem to blame one of my project files being responsible for the error?!?!

Traceback (most recent call last):
  File "C:\Users\ha\AppData\Local\Continuum\Anaconda3\Scripts\nuitka", line 181,
in <module>
    MainControl.main()
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\MainControl.py",
line 695, in main
    filename = filename
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\MainControl.py",
line 90, in createNodeTree
    module_package  = None
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\importing\Recursion.py",
line 353, in checkPluginPath
    _checkPluginPath(plugin_filename, module_package)
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\importing\Recursion.py",
line 325, in _checkPluginPath
    _checkPluginPath(sub_path, module.getFullName())
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\importing\Recursion.py",
line 325, in _checkPluginPath
    _checkPluginPath(sub_path, module.getFullName())
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\importing\Recursion.py",
line 266, in _checkPluginPath
    reason          = "Lives in plug-in directory."
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\importing\Recursion.py",
line 63, in recurseTo
    source_filename = source_filename
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\tree\SourceReading.py",
line 137, in readSourceCodeFromFilename
    source_code = _readSourceCodeFromFilename3(source_filename)
  File
"C:\Users\ha\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\tree\SourceReading.py",
line 44, in _readSourceCodeFromFilename3
    return source_code.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 331:
invalid start byte
msg1640 (view) Author: kayhayen Date: 2015-10-18.10:37:55
The latest pre-release ought to be good with this. Please test
msg1635 (view) Author: kayhayen Date: 2015-10-13.19:44:48
For "scons", Nuitka is on Windows using the inline copy, which is Python2 code, and 
ought to work just fine, it's searched in the Python3 install, because that is 
where your Nuitka installation is.

The subprocess failure is rather about MinGW on 64 bits not able to find the Python 
DLL to create a LIB file for MinGW to use. I suspect that MinGW and Anaconda Python 
do not mix well yet, by virtue of hardcoded path to the Python DLL to be installed 
in the system.

Using MSVC will work, using 32 bits will work. And once I fix this, your current 
install will work.

I need to check if CPython installation put the DLL also in the installation 
folder, or only system folder. For "uninstalled" Python, already, there is code to 
find it in the installation prefix, that could just be used more generally.

Alternatively you can change these codes in nuitka/build/SingleExe.scons

        command = r"gendef - %s\SysWOW64\python%s.dll" % (
                os.environ["WINDIR"],
                python_version.replace('.', "")
            )

        shutil.copy(
            r"%s\SysWOW64\python%s.dll" % (
                os.environ["WINDIR"],
                python_version.replace('.', "")
            ),
            new_win_lib_path
        )

To properly reference a path that is your Python3 DLL.

Also, is there an easy guess for Anaconda, to find a Python2 install, do these 
reside relatively to another at similar paths, then Nuitka could try and guess 
these locations too, not just the CPython paths.

Yours,
Kay
msg1634 (view) Author: phoriwan Date: 2015-10-13.12:31:08
I'm actually trying to compile a python3 project. During the first attempt
nuitka told me that "scons" is needed and therefor Python 2.x has to be in
C:\Python27. So I copied my Winpython 2.7x to this directory. 

Now the compilation process fails with:
WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden:
  File
"C:\Users\XX\AppData\Local\Continuum\Anaconda3\Lib\site-packages\nuitka\build\SingleExe.scons",
line 874:
    shell       = False
  File "c:\Python27\lib\subprocess.py", line 710:
    errread, errwrite)
  File "c:\Python27\lib\subprocess.py", line 958:
    startupinfo)


I guess that nuitka tries to access Scons not somewhere in the C:\Python27
directory but in my Python3 directory
(C:\Users\XX\AppData\Local\Continuum\Anaconda3\Lib\site-packages\...)?!?!
History
Date User Action Args
2015-10-30 09:58:42kayhayensetstatus: testing -> resolved
assignedto: kayhayen
nosy: + kayhayen
2015-10-28 12:01:44phoriwansetmessages: + msg1672
2015-10-18 10:38:01kayhayensettitle: Anaconda Python and MinGW do not work together -> Windows: Anaconda Python and MinGW do not work together
2015-10-18 10:37:55kayhayensetstatus: chatting -> testing
messages: + msg1640
2015-10-13 19:44:48kayhayensetmessages: + msg1635
title: Python3 Compilation under Windows: SingleExe.scons searched in Python3 Path -> Anaconda Python and MinGW do not work together
2015-10-13 12:31:08phoriwansetstatus: unread -> chatting
messages: + msg1634
2015-10-13 12:27:31phoriwancreate