I am trying to execute a python script using batch file but it is not executing .
Hello All ,
I am using IBM ALM (specifically EWM ) of version 7.0.2 SR1 having ifix : "iFix020"
I am trying to execute my python script using batch file . It is starting the execution and loading all the data as well but it is stucking at the place where I have put the code for requesting a 'GET' request to my server .
It means that the connection is not getting created with the server and it is throwing an error as below
: " HTTPSConnectionPool(host='rb-alm-06-p.de.bosch.com', port=443): Max retries exceeded with url: /ccm/oslc/contexts/_E7kQ8O3oEeazrI_2NwYkHA/workitems?oslc_cm.query=dc:created%3E%222023-03-13T01:19:31.821Z%22/sort=dc:identifier (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))"
And when I am executing the file manually without using batch file directly through my IDE i.e. "Spyder" its executing successfully with final output
SO the question is "GET" request is working when I am executing though spyder and when I am trying to execute it using batch file then "GET" request is not working .
So my question is that is there any extra permission needed to run BATCH file to get connected to server from ADMIN side or it is something else .
My BATCH file contains :
@echo OFF
set "userName=*******r"
set "password=**********"
echo This is Username %userName%
echo This is password %password%
ping "rb-*********.bosch.com"
"C:\Program Files\Anaconda3\python.exe" "C:\Users\*******\Desktop\EstimationTool_2.0\EstimationTool-Job2\untitled10.py"
pause
set "userName=*******r"
set "password=**********"
echo This is Username %userName%
echo This is password %password%
ping "rb-*********.bosch.com"
"C:\Program Files\Anaconda3\python.exe" "C:\Users\*******\Desktop\EstimationTool_2.0\EstimationTool-Job2\untitled10.py"
pause
If anyone knows about this then please let me know .
Thaks in advance
Accepted answer
My assumption is, you have to provide some environment information about the additional packages that are required to run the script. This is a question for a Python Forum and not this forum here. Consider checking with other forums how to include installed packages when running Python scripts from the command line.
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 18 '23, 4:00 a.m.Did you try investigating the error message: SSLError("Can't connect to HTTPS URL because the SSL module is not available.") ?
Akash Kaanholkar
Apr 18 '23, 5:46 a.m.Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 18 '23, 6:29 a.m.That's what the error message says... I don't suppose it made this up just to confuse you.
Akash Kaanholkar
Apr 18 '23, 6:32 a.m.Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 18 '23, 7:02 a.m.The error message says SSL isn't available so presumably that's why it won't/can't connect to your server. It's something to do with your environment/the python version you're running this with.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 18 '23, 7:27 a.m.In Spyder you might have installed certain modules, that are not available the way you call it in the batch file. I don't think this is anything we can help with. I'd suggest to search the internet for this stuff.
Akash Kaanholkar
Apr 18 '23, 7:37 a.m.Thanks Ian and Ralph
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 18 '23, 7:45 a.m.See https://stackoverflow.com/questions/54135206/caused-by-sslerrorcant-connect-to-https-url-because-the-ssl-module-is-not-ava