bookmonkie
bookmonkie

Reputation: 449

python, difference between import ssl and import _ssl

What is the difference between

import ssl 

and

import _ssl

I am running python code on different servers. On some servers, both works for me. On other servers, only the second one works, the first one gives me the following:

ImportError: No module named ssl

Upvotes: 5

Views: 442

Answers (1)

Mad Wombat
Mad Wombat

Reputation: 15135

They are different modules. _ssl is an internal support module for SSL operations where ssl is the actual module providing SSL services. "No module named ssl" means that on that server python was not compiled with SSL support.

Upvotes: 5

Related Questions