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.

ModuleNotFoundError: No module named 'http.cookiejar'

See original GitHub issue

t.py:

while 1: exec(input('> '))

v0.8rc9:

~~~>C:\Python37x86\python -m nuitka --standalone --mingw64 t.py

Nuitka-Options:INFO: Used command line options: --standalone --mingw64 t.py
Nuitka:INFO: Starting Python compilation with Nuitka '0.8rc9' on Python '3.7' commercial None.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'wsgiref.simple_server' added 'http.server'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'urllib.request' added 'http.client'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'socket' added '_socket'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'shelve' added 'dbm.dumb'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'pathlib' added 'ntpath,posixpath'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'ctypes' added '_ctypes'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module '_asyncio' added 'asyncio'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'locale' added '_bootlocale'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'encodings' added 'encodings.idna,encodings.base64_codec,encodings.hex_codec,encodings.rot_13'.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka-Scons:INFO: Backend linking program (no progress information available).
Nuitka-Scons:INFO: Compiled 20 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache hit': 8
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache miss': 1
Nuitka:INFO: Keeping build directory 't.build'.
Nuitka:INFO: Successfully created 't.dist\\t.exe'.

~~~>t.dist\t.exe
> import http.server
> import http.cookiejar
Traceback (most recent call last):
  File "C:\Users\Tester\Desktop\ttr\y\TBDD7~1.DIS\t.py", line 25, in <module>
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'http.cookiejar'

v0.6.19.7:

~~~>python -m nuitka --standalone --mingw64 t.py
Nuitka-Options:INFO: Used command line options: --standalone --mingw64 t.py
Nuitka:INFO: Starting Python compilation with Nuitka '0.6.19.7' on Python '3.7' commercial None.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'tkinter' added '_tkinter'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'socket' added '_socket'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'ctypes' added '_ctypes'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'locale' added '_bootlocale'.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka-Scons:INFO: Compiled 11 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache hit': 10
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache miss': 1
Nuitka-Plugins:INFO: data-files: Included data file 'lib2to3\Grammar3.7.9.final.0.pickle' due to package data for 'lib2to3.pgen2'.
Nuitka-Plugins:INFO: data-files: Included data file 'lib2to3\PatternGrammar3.7.9.final.0.pickle' due to package data for 'lib2to3.pgen2'.
Nuitka:INFO: Keeping build directory 't.build'.
Nuitka:INFO: Successfully created 't.dist\\t.exe'.

~~~>t.dist\t.exe
> import http.server
> import http.cookiejar
> 

Here is reports for full comparison:

0.6.19.7.xml.zip

0.8rc9.xml.zip

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, May 3, 2022

I have added the dependency to urllib.requests where it belongs, confused myself there. https://nuitka.net/doc/factory.html

1reaction
ralienppcommented, May 2, 2022

My current workaround for this problem is to add import http.cookiejar # noqa to the file Nuitka compiles, to explicitly tell it that I want it to be imported. The “noqa” comment is needed if you have any tools like flake8 or pylint that will complain about unused imports.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: No module named http.cookiejar · Issue #178
When i give the command python social_mapper.py -h , it doesn't execute but shows the following error: Traceback (most recent call last):
Read more >
Gitzilla: missing python http.cookiejar module - Stack Overflow
From this I figure I need http.cookiejar (or cookielib) installed but I don't know how to get it. I've tried without success: pip...
Read more >
No module named 'pycopy-http.cookiejar' - RoseIndia.Net
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pycopy-http.cookiejar' How to remove.
Read more >
http.cookiejar — Cookie handling for HTTP clients — Python ...
The http.cookiejar module defines classes for automatic handling of HTTP cookies. It is useful for accessing web sites that require small pieces of...
Read more >
python 2.7报错No module named http.cookiejar - CSDN
1. ModuleNotFoundError: No module named 'cookielib' ...Python3中,importcookielib改成importhttp.cookiejar,然后方法里cookielib也改成http.
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