0

I have a problem with following script:

import requests

path = 'https://www.google.com/'

r = requests.get(path)

print(r.status_code)

When I am running this code in spyder IDE it is working properly.

When I am running it from console with commands:

activate my_env
python script.py

It is also working.

But when I am running it from console with command:

C:\Users\user\AppData\Local\conda\conda\envs\my_env\python.exe script.py

It gives me error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='www.google.com', port=44 3): Max retries exceeded with url: / (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

I was trying to add proxies param and certificate location to verify param, but nothing seems to help.

I am using python 3.7 and my working environment is Windows Server 2012.

AMC
  • 2,466
  • 7
  • 11
  • 31
marcin
  • 292
  • 1
  • 9

1 Answers1

0

I was able to find answer, I can't believe I haven't seen it before.

In short, copy files libcrypto-1_1-x64.*, libssl-1_1-x64.* from D:\Anaconda3\Library\bin to D:\Anaconda3\DLLs.

marcin
  • 292
  • 1
  • 9