Compiling python code that uses six.py somewhere in the import chain
See original GitHub issueSteps:
- Compile any code that has six.py in it’s import chain - e.g. direct usage or imports some module which eventually imports six.py e.g.
~/temp/glances $ nuitka --python-version=3.5 --portable --recurse-all /usr/bin/glances
Nuitka:WARNING:Unresolved '__import__' call at '/home/gsjy/.local/lib/python3.5/site-packages/six.py:82' may require use of '--recurse-directory'.
- Try running the generated code. Result:
~/temp/glances$ glances.dist/glances.exe
Traceback (most recent call last):
File "/home/gsjy/temp/glances/glances.dist/glances", line 5, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/home/gsjy/temp/glances/glances.dist/pkg_resources/__init__.py", line 51, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/home/gsjy/temp/glances/glances.dist/pkg_resources/extern/__init__.py", line 43, in load_module
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
KeyError: 'six'
- Nuitka version 0.5.28.1, Python 3.5.2 and Python 2.7.12 on Ubuntu 16.04 and Windows 10
- Python installed and kept up to date by the APT, nuitka installed and managed by pip
- No virtualenv
- Looks like issue is not a regression.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Compiling python code that uses six.py somewhere ... - GitHub
Steps: Compile any code that has six.py in it's import chain - e.g. direct usage or imports some module which eventually imports six.py...
Read more >py_compile — Compile Python source files — Python 3.11.1 ...
The py_compile module provides a function to generate a byte-code file from a source file, and another function used when the module source...
Read more >Your Guide to the CPython Source Code - Real Python
In this detailed Python tutorial, you'll explore the CPython source code. By following this step-by-step walkthrough, you'll take a deep ...
Read more >Dragon taming with Tailbiter, a bytecode compiler for Python
Her chapter explains the CPython bytecode virtual machine, which takes the output of a compiler and executes it. I've tried to make this...
Read more >Python Modules: Creating, Importing, and Sharing - Stack Abuse
Since Python is interpreted language, it runs the imported module's code once it reaches an import or from statement. Later imports within the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you try out develop branch. I recall that I did some work around its meta path based importer, but I am unsure now.
@alex-pobeditel-2004 What makes you think this is the original issue, because it is not. Report a new issue.