-2

I am trying to execute the code at docs.python.org

import socket
import ssl

hostname = 'www.python.org'
context = ssl.create_default_context()

with socket.create_connection((hostname, 443)) as sock:
    with context.wrap_socket(sock, server_hostname=hostname) as ssock:
        print(ssock.version())

I installed Win64OpenSSL_Light-1_1_1L which I downloaded from Shining Light Productions.

In the directory Windows\System32 libcrypto-1_1-x64.dll v 1.1.1.12 is installed. Python version is 3.9.

When I attempt to pip install ssl from within Pycharm (as well as from an external cmd window run as administrator) it crashes with the output below:

Collecting ssl  
  Using cached ssl-1.16.tar.gz (33 kB)  
    ERROR: Command errored out with exit status 1:  
     command: 'C:\Users\chribonn\.virtualenvs\ssl01\Scripts\python.exe' -c 'import io, os, sys,setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\chribonn\\AppData\\Local\\Temp\\pip-install-jiqpumyk\\ssl_bb978a5b89144b28940340898b82f710\\setup.py'"'"'; __file__='"'"'C:\\Users\\chribonn\\AppData\\Local\\Temp\\pip-install-jiqpumyk\\ssl_bb978a5b89144b28940340898b82f710\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"',open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code =f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\chribonn\AppData\Loca

l\Temp\pip-pip-egg-info-mozgaod0'

     cwd: C:\Users\chribonn\AppData\Local\Temp\pip-install-jiqpumyk\ssl_bb978a5b89144b28940340898b82f710\  
Complete output (6 lines):  
Traceback (most recent call last):  
  File "<string>", line 1, in <module>  
  File "C:\Users\chribonn\AppData\Local\Temp\pip-install-jiqpumyk\ssl_bb978a5b89144b28940340898b82f710\setup.py", line 33  
    print 'looking for', f  
          ^  
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?  
----------------------------------------  
chribonn
  • 445
  • 5
  • 20

1 Answers1

2

Topic answered by @KlausD.

ssl is part of Python 3.9 and there is no need to pip install ssl.

chribonn
  • 445
  • 5
  • 20