question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:26 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
namuyancommented, Sep 18, 2019

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.

1reaction
kayhayencommented, Jul 21, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | PyCharm Documentation - JetBrains
In the Settings/Preferences dialog ( Ctrl+Alt+S ), navigate to Build, Execution, Deployment | Python Debugger, and clear the PyQt compatible ...
Read more >
Package installation issues | PyCharm Documentation
Install a package on a virtual environment. Press Ctrl+Alt+S to open the IDE settings and select Project <project name> | Python Interpreter.
Read more >
PyCharm can't install/import a package/library/module
Try installing/importing a package from the system terminal (outside of PyCharm) using the same interpreter/environment.
Read more >
PyCharm not opening on Windows 10
Whenever I try to launch PyCharm from the stat menu, it almost feels like there's a 50/50 chance of the window actually popping...
Read more >
Configure a virtual environment | PyCharm Documentation
If PyCharm displays the Invalid environment warning, it means that the specified Python binary cannot be found in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found