ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 224 forks source link

SSL problem with Anaconda #11729

Open AlexisData opened 4 years ago

AlexisData commented 4 years ago

Actual Behavior

I have a script sending message to the Telegram Messenger API.

When I run it in Spyder, everything is ok.

When I use the batch created using "C:\Users\Alex\anaconda3\python.exe" as path in my txt file, I have the following errors (in Anaconda Prompt)


 "Can't connect to HTTPS URL because the SSL module is not available."
urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.

"requests.exceptions.SSLError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot9[confidential url] (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))"

Expected Behavior

When I launch my script in SPyder, everything is ok : I receive the text I want to receive on my Instagram messenger account. I would like to be able to do the same with my batch file.

Steps to Reproduce

I have a script as follow : def telegram_bot_sendtext(bot_message):

bot_token = 'token'
bot_chatID = '-id'
send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message
response = requests.get(send_text)

return response.json()

telegram_bot_sendtext("text")

I created the batch file using : "C:\Users\Alex\anaconda3\python.exe" "C:\Users\Alex\Desktop\U\project.py" pause

Anaconda or Miniconda version:

Anaconda3 . 2020.02

Operating System:

I'm on Windows 10 v1903

jjhelmus commented 4 years ago

You need to activate the environment in the batch file prior to calling conda. More details can be found in the [documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activate-env