Problems compiling code which imports dulwich module
See original GitHub issueHello!
I’ve got a problem with Nuitka while trying to compile Python code which uses dulwich - Python implementation of Git.
nuitka --follow-imports --standalone --output-dir="C:\Users\user\build" C:\Users\user\build\nuitka_test.py
Here is the minimal piece of code which allows to reproduce the problem (there are actually 2 of them):
from dulwich import porcelain
def main():
pass
if __name__ == "__main__":
main()
The first warning is the six.py
import problem (quite similar to issue #56):
Nuitka:WARNING:Unresolved '__import__' call at 'C:\Program Files\Python36\lib\site-packages\urllib3\packages\six.py:82' may require use of '--include-plugin-directory' or '--include-plugin-files'.
The consequence of this warning is the error arising when I try to execute some network-related code from the compiled executable (clone git repo, for example):
HTTPSConnectionPool(host='gitlab.company.com', port=443): Max retries exceeded with url: /project/repository.git/info/refs?service=git-upload-pack (Caused by SSLError(FileNotFoundError(2, 'No such file or directory'),))
The second problem is the exception:
IndexError: list index out of range:
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\SingleExe.scons", line 477:
env = createEnvironment(compiler_tools=compiler_tools)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\SingleExe.scons", line 462:
**args
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Environment.py", line 982:
apply_tools(self, tools, toolpath)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Environment.py", line 107:
env.Tool(tool)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Environment.py", line 1789:
tool(self)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\__init__.py", line 299:
self.generate(env, *args, **kw)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\default.py", line 40:
for t in SCons.Tool.tool_list(env['PLATFORM'], env):
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\__init__.py", line 1271:
c_compiler = FindTool(c_compilers, env) or c_compilers[0]
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\__init__.py", line 1172:
if t.exists(env):
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\msvc.py", line 292:
return msvc_exists(env)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\MSCommon\vc.py", line 759:
vcs = cached_get_installed_vcs(env)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\MSCommon\vc.py", line 524:
ret = get_installed_vcs(env)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\MSCommon\vc.py", line 535:
VC_DIR = find_vc_pdir(ver)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\MSCommon\vc.py", line 344:
comps = find_vc_pdir_vswhere(msvc_version)
File "C:\Program Files\Python36\lib\site-packages\nuitka\build\inline_copy\lib\scons-3.0.4\SCons\Tool\MSCommon\vc.py", line 306:
vc_pdir = os.path.join(vsdir[0], 'VC')
If I use just import dulwich
in my code, only the second problem persists (but I didn’t find out which consequences it brings)
This behaviour tested on Python 3.6.1 in Windows 10 and Debian 9.4.
Nuitka (0.6.1 … 0.6.3) and Dulwich (0.19.8) were installed via pip.
Maybe this issue would also be interesting for @jelmer who is an initial dulwich developer.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
I could’t install Python2 version due to missing C compiler MSVC 9 from PyPI, but I don’t think it matters.
Tried this on Windows just now, works fine with current development version of Nuitka and probably stable version too, tried it with Python3.9 and latest dulwich in standalone mode.