Star imports of built-in names are not working as expected
See original GitHub issueToday I wanted to try a very fast experiment, the idea was trying to create executables for all the existing matplotlib examples, here’s what I did so far:
-
Having a virtualenv with these requirements (i’ve got more but just posting the basic ones to run many of the matplotlib examples):
matplotlib==2.2.2 pyparsing==2.2.0 python-dateutil==2.7.3 cycler==0.10.0 numpy==1.14.0+mkl
-
git clone https://github.com/matplotlib/matplotlib
and make sure I was able to run all included examples, so far so good, all of them would run flawlessly (tested manually many dozens) -
Create nuitka modules by doing:
nuitka --output-dir=build --no-pyi-file --include-package=cycler --module --jobs=4 --show-scons D:\virtual_envs\py364_32\lib\site-packages\cycler.py nuitka --output-dir=build --no-pyi-file --include-package=dateutil --module --jobs=4 --show-scons D:\virtual_envs\py364_32\lib\site-packages\dateutil nuitka --output-dir=build --no-pyi-file --include-package=matplotlib --module --jobs=4 --show-scons D:\virtual_envs\py364_32\lib\site-packages\matplotlib nuitka --output-dir=build --no-pyi-file --include-package=numpy --module --jobs=4 --show-scons D:\virtual_envs\py364_32\lib\site-packages\numpy nuitka --output-dir=build --no-pyi-file --include-package=pyparsing --module --jobs=4 --show-scons D:\virtual_envs\py364_32\lib\site-packages\pyparsing.py
-
Finally, copying manually the required implicit dlls/data to use numpy&matplotlib.
I’ve created a beautiful package to give more relevant information, you can download from here
Once you’ve extracted that nice package containing all dependencies the idea was I’d just set PYTHONPATH
pointing out to that folder (absolute path) and everything would run flawlessly… Well, unfortunately the plan fail and it didn’t work 😉
Anyway, here’s the current traceback I’ve got stuck with:
(py364_32) D:\sources\others\sources_compilers\nuitka_tests\matplotlib\examples\color>echo %PYTHONPATH%
D:\sources\others\sources_compilers\nuitka_tests\bin
(py364_32) D:\sources\others\sources_compilers\nuitka_tests\matplotlib\examples\color>python color_by_yvalue.py
D:\sources\others\sources_compilers\nuitka_tests\bin\matplotlib\__init__.py:1004: UserWarning: could not find rc file; returning defaults
<module 'numpy' from 'D:\\sources\\others\\sources_compilers\\nuitka_tests\\bin\\numpy.pyd'>
Traceback (most recent call last):
File "color_by_yvalue.py", line 25, in <module>
ax.plot(t, smiddle, t, slower, t, supper)
File "D:\sources\others\sources_compilers\nuitka_tests\bin\matplotlib\__init__.py", line 1855, in inner
File "D:\sources\others\sources_compilers\nuitka_tests\bin\matplotlib\axes\_axes.py", line 1531, in plot
File "D:\sources\others\sources_compilers\nuitka_tests\bin\matplotlib\axes\_base.py", line 2516, in autoscale_view
File "D:\sources\others\sources_compilers\nuitka_tests\bin\matplotlib\axes\_base.py", line 2500, in handle_single_axis
File "D:\sources\others\sources_compilers\nuitka_tests\bin\numpy\core\numeric.py", line 2334, in isclose
TypeError: 'numpy.bool_' object is not iterable
Can you think of any reason why I’m getting this error when trying to use the modules generated by nuitka? Do you see any nuitka command missing any relevant arguments on my previous steps?
This plan was great, proving that I’d be able to build all matplotlib very fast and having them running on other boxes without python installed would be quite amazing (at least in my books)
Regards, B
Ps. nuitka(develop) + 3.6.x + win7 + vs2015
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (19 by maintainers)
Make it a new issue, definitely its another one. Not sure what could be going on there, maybe something is duplicated that shouldn’t be. I would appreciate a reproducer, although bi-sect is welcome.
My expectation is that the new global dict names registry finds an existing bug that was previously not found. It was of course tested.
And this is basically only delayed, because getting out what is already there, has to have higher priority, but only that. I expect to release on weekend and start working on phase 1 of the solution I described. I changed the subject, to make it clear. Feel free to raise other issues once you proceed with the tests and create new issues. You will know because I will close it or put the factory label on, say it’s in develop, etc. that is how I make things known.