Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't compile Python using Nuitka

I'm trying to compile Python file which uses urllib.request, BeautifulSoup, and webbrowser.

$ nuitka python.py
Nuitka:WARNING:python.py:16: Cannot find 'urllib.request' as relative or absolute import.
Nuitka:WARNING:python.py:17: Cannot find 'bs4' as relative or absolute import.

$ ./python.exe
Traceback (most recent call last):
  File "python.py", line 16, in <module>
    from urllib.request import urlopen
ImportError: No module named request
like image 763
George J Avatar asked Dec 19 '25 14:12

George J


1 Answers

Try to add --recurse-to=urllib to command line during Nuitka execution. See Nuitka help for details.

like image 111
M. Hebda Avatar answered Dec 22 '25 05:12

M. Hebda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!