Nuitka: PyCharm: Can't compile anything on Windows 10 in its environment

Noob here, if I’m missing anything, please do point out.

  • Nuitka version, full Python version and Platform (Windows, OSX, Linux …)

0.6.4 (stable) / 0.6.5rc4 (dev) Python: 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] Executable: D:\ProgramData\Anaconda3\python.exe OS: Windows Arch: x86_64

  • How did you install Nuitka and Python (pip, anaconda, deb, rpm, from source, what is a virtualenv …), this is very important usually.

Nuitka stable from conda or dev from pip, Python from conda.

  • Many times when you get an error from Nuitka, your setup may be so special that even a “hello world” program will not work, please try that and report it instead.

Exactly. Here’s the console output when I try to compile a simple “hello world”:

(base) D:\PycharmProjects\hw>python -m nuitka --standalone --show-progress hw.py
Nuitka:INFO:PASS 1:
Nuitka:INFO:Initial optimization pass.
Nuitka:INFO:Optimizing module '__main__', 19 more modules to go after that.
Nuitka:INFO:Doing module local optimizations for '__main__'.
Nuitka:INFO:Optimizing module 'site', 21 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'site':
Nuitka:INFO:Optimizing module 'types', 20 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'types':
Nuitka:INFO:Optimizing module 'os', 19 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'os':
Nuitka:INFO:Optimizing module 'select', 18 more modules to go after that.
Nuitka:INFO:Optimizing module 'pythoncom', 17 more modules to go after that.
Nuitka:INFO:Optimizing module 'pyexpat', 16 more modules to go after that.
Nuitka:INFO:Optimizing module '_tkinter', 15 more modules to go after that.
Nuitka:INFO:Optimizing module '_ssl', 14 more modules to go after that.
Nuitka:INFO:Optimizing module '_sqlite3', 13 more modules to go after that.
Nuitka:INFO:Optimizing module '_socket', 12 more modules to go after that.
Nuitka:INFO:Optimizing module '_queue', 11 more modules to go after that.
Nuitka:INFO:Optimizing module '_overlapped', 10 more modules to go after that.
Nuitka:INFO:Optimizing module '_multiprocessing', 9 more modules to go after that.
Nuitka:INFO:Optimizing module '_msi', 8 more modules to go after that.
Nuitka:INFO:Optimizing module '_lzma', 7 more modules to go after that.
Nuitka:INFO:Optimizing module '_hashlib', 6 more modules to go after that.
Nuitka:INFO:Optimizing module '_elementtree', 5 more modules to go after that.
Nuitka:INFO:Optimizing module '_decimal', 4 more modules to go after that.
Nuitka:INFO:Optimizing module '_ctypes', 3 more modules to go after that.
Nuitka:INFO:Optimizing module '_asyncio', 2 more modules to go after that.
Nuitka:INFO:Optimizing module 'unicodedata', 1 more modules to go after that.
Nuitka:INFO:Optimizing module '_bz2', 0 more modules to go after that.
Nuitka:INFO:Next global optimization pass.
Nuitka:INFO:Optimizing module '__main__', 19 more modules to go after that.
Nuitka:INFO:Doing module local optimizations for '__main__'.
Nuitka:INFO:Optimizing module 'site', 21 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'site':
Nuitka:INFO:Optimizing module 'types', 20 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'types':
Nuitka:INFO:Optimizing module 'os', 19 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'os':
Nuitka:INFO:Optimizing module 'select', 18 more modules to go after that.
Nuitka:INFO:Optimizing module 'pythoncom', 17 more modules to go after that.
Nuitka:INFO:Optimizing module 'pyexpat', 16 more modules to go after that.
Nuitka:INFO:Optimizing module '_tkinter', 15 more modules to go after that.
Nuitka:INFO:Optimizing module '_ssl', 14 more modules to go after that.
Nuitka:INFO:Optimizing module '_sqlite3', 13 more modules to go after that.
Nuitka:INFO:Optimizing module '_socket', 12 more modules to go after that.
Nuitka:INFO:Optimizing module '_queue', 11 more modules to go after that.
Nuitka:INFO:Optimizing module '_overlapped', 10 more modules to go after that.
Nuitka:INFO:Optimizing module '_multiprocessing', 9 more modules to go after that.
Nuitka:INFO:Optimizing module '_msi', 8 more modules to go after that.
Nuitka:INFO:Optimizing module '_lzma', 7 more modules to go after that.
Nuitka:INFO:Optimizing module '_hashlib', 6 more modules to go after that.
Nuitka:INFO:Optimizing module '_elementtree', 5 more modules to go after that.
Nuitka:INFO:Optimizing module '_decimal', 4 more modules to go after that.
Nuitka:INFO:Optimizing module '_ctypes', 3 more modules to go after that.
Nuitka:INFO:Optimizing module '_asyncio', 2 more modules to go after that.
Nuitka:INFO:Optimizing module 'unicodedata', 1 more modules to go after that.
Nuitka:INFO:Optimizing module '_bz2', 0 more modules to go after that.
Nuitka:INFO:PASS 2 ... :
Nuitka:INFO:Next global optimization pass.
Nuitka:INFO:Optimizing module '__main__', 19 more modules to go after that.
Nuitka:INFO:Doing module local optimizations for '__main__'.
Nuitka:INFO:Optimizing module 'site', 21 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'site':
Nuitka:INFO:Optimizing module 'types', 20 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'types':
Nuitka:INFO:Optimizing module 'os', 19 more modules to go after that.
Nuitka:INFO:Doing module dependency considerations for 'os':
Nuitka:INFO:Optimizing module 'select', 18 more modules to go after that.
Nuitka:INFO:Optimizing module 'pythoncom', 17 more modules to go after that.
Nuitka:INFO:Optimizing module 'pyexpat', 16 more modules to go after that.
Nuitka:INFO:Optimizing module '_tkinter', 15 more modules to go after that.
Nuitka:INFO:Optimizing module '_ssl', 14 more modules to go after that.
Nuitka:INFO:Optimizing module '_sqlite3', 13 more modules to go after that.
Nuitka:INFO:Optimizing module '_socket', 12 more modules to go after that.
Nuitka:INFO:Optimizing module '_queue', 11 more modules to go after that.
Nuitka:INFO:Optimizing module '_overlapped', 10 more modules to go after that.
Nuitka:INFO:Optimizing module '_multiprocessing', 9 more modules to go after that.
Nuitka:INFO:Optimizing module '_msi', 8 more modules to go after that.
Nuitka:INFO:Optimizing module '_lzma', 7 more modules to go after that.
Nuitka:INFO:Optimizing module '_hashlib', 6 more modules to go after that.
Nuitka:INFO:Optimizing module '_elementtree', 5 more modules to go after that.
Nuitka:INFO:Optimizing module '_decimal', 4 more modules to go after that.
Nuitka:INFO:Optimizing module '_ctypes', 3 more modules to go after that.
Nuitka:INFO:Optimizing module '_asyncio', 2 more modules to go after that.
Nuitka:INFO:Optimizing module 'unicodedata', 1 more modules to go after that.
Nuitka:INFO:Optimizing module '_bz2', 0 more modules to go after that.
Nuitka:INFO:Total memory usage before generating C code: 36.15 MB (37908480 bytes):
Nuitka:INFO:Total memory usage before running scons: 41.90 MB (43937792 bytes):
Traceback (most recent call last):
  File "D:\ProgramData\Anaconda3\lib\site-packages\nuitka\__main__.py", line 184, in <module>
    main()
  File "D:\ProgramData\Anaconda3\lib\site-packages\nuitka\__main__.py", line 177, in main
    MainControl.main()
  File "D:\ProgramData\Anaconda3\lib\site-packages\nuitka\MainControl.py", line 768, in main
    executePostProcessing(getResultFullpath(main_module))
  File "D:\ProgramData\Anaconda3\lib\site-packages\nuitka\PostProcessing.py", line 59, in executePostProcessing
    lang_id=0,
  File "D:\ProgramData\Anaconda3\lib\site-packages\nuitka\utils\WindowsResources.py", line 234, in addResourceToFile
    update_handle = _openFileWindowsResources(target_filename)
  File "D:\ProgramData\Anaconda3\lib\site-packages\nuitka\utils\WindowsResources.py", line 159, in _openFileWindowsResources
    raise ctypes.WinError()
FileNotFoundError: [WinError 2] The system cannot find the file specified.
  • Additional info

I tried 3 possible C compilers, as guided by the user manual: VS Build Tools 2019, a standalone MinGW64 installation, or conda’s m2w64-gcc. All of them halt at the same place with the same error. The issues seems almost identical to what’s in this comment, except that installing MinGW64 didn’t fix it for me (in fact it’s the first C compiler I tried).

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I may find solution. https://github.com/Nuitka/Nuitka/blob/develop/nuitka/utils/WindowsResources.py#L253 just add 2 lines

def addResourceToFile(target_filename, data, resource_kind, lang_id, res_name):
    import os
    target_filename = os.path.abspath(target_filename)
    
    update_handle = _openFileWindowsResources(target_filename)

    _updateWindowsResource(update_handle, resource_kind, res_name, lang_id, data)

    _closeFileWindowsResources(update_handle)

I don’t know why, just change relative Path to absolute Path, the problem was solved on my system. Problem occurred on Linux separator? Please try.

Ok, I will try and add some traces and checks to to cover this.

When this is the case, it would have to mean that Scons failed to produce an executable, yet gave no error, or which is more possible, that Anaconda3 adds no resources, and maybe that updating without deleting resources fails. I am updating my Anaconda3 right now to see if I can reproduce it myself.

Yours, Kay