0

I'm trying to run the line:

r = requests.get('https://api.twitch.tv/helix/streams?user_login='+CHAN[1:], headers=headers)

but am getting the following error:

Can't connect to HTTPS URL because the SSL module is not available

Now here's where things get confusing. I can run this same exact line in Visual Studio 2019 on my computer, no problem. I can run this same exact line no problem on online compilers, no problem. But when I try to run this in the game Assetto Corsa I get this error.

Why will this run on my computer but not in a game that runs on my computer? How do I solve it? Is there a python SSL module I can manually install in my game folder maybe?

Side Notes that Might Help:

Rayaarito
  • 400
  • 4
  • 21
  • There are similar questions, ie: https://stackoverflow.com/questions/41328451/ssl-module-in-python-is-not-available-when-installing-package-with-pip3 – Ivar Apr 07 '20 at 13:27
  • Thanks for the quick comment @Aivaras. I was looking at that question last night. I'm on Windows and don't use Anaconda. So that answer does not apply. I also already installed OpenSSL and am still having the issue. So that answer doesn't apply either – Rayaarito Apr 07 '20 at 13:29
  • 1
    Aside from similarities it is not clear what "when I try to run this in the game" means. Your "game" could have its own python version that does not know (or fails to know) where ssl package is on the machine. – Ivar Apr 07 '20 at 13:29
  • @Aivaras, I have a feeling that you're right and that tells me I would need to find the SSL module, download it, and import it manually to my in-game app. Any idea where I can find it? – Rayaarito Apr 07 '20 at 13:31
  • I would not be so sure what to do on Windows but Google searches show `pyOpenSSL` as an option for establishing network connections https://pypi.org/project/pyOpenSSL/ . `pip install pyOpenSSL` might fix it – Ivar Apr 07 '20 at 13:43

1 Answers1

0

Assetto corsa does have it's own python in its folder (python33.zip).

As far as I could see on github, apps include explicitly the code of the libraries they're using either as .pyd files or as source code.

You can see https://github.com/martinbjeldbak/openTracker for including the requests module.

What I did to find it and other examples was running a search Assetto Corsa in github and filter the results by python (there are less than 80).

I hope this helps you

poponiv
  • 1
  • 1