Kevin Tewouda
Kevin Tewouda

Reputation: 11

ImportError: No module named xxxxx

I know this question has already been asked several times on the site, but I have not seen any satisfactory answer. I have a project partitionned like this

TLS project (folder)
sniffer_tls.py
| - tls (folder)
     | - __init__.py
     | - tls_1_2.py
         | - handshake (folder)
             | --__ Init__.py
             | - client_hello.py

when I am importing tls_1_2.py sniffer_tls.py in the main file, there is no problem. By cons when I import client_hello in tls_1_2.py, there python that mistake me out

File "/home/kevin/Documents/Python/Projet TLS/tls/tls_1_2.py", line 8, in 
    import handshake.client_hello
ImportError: No module named 'handshake'

I tried to import this way import handshake.client_hello and then I tried another way that I read on the forum import client_hello from handshake.client_hello I deleted the init.py file to test, it does not work either, I really need help to solve this problem

Upvotes: 1

Views: 333

Answers (1)

dgeorgiev
dgeorgiev

Reputation: 941

You seem to have a typo in your "handshake" __init__.py file. Instead you've named it __Init__.py with capital 'I'

Upvotes: 2

Related Questions