It's all about the answers!

Ask a question

I am trying to execute a python script using batch file but it is not executing .


Akash Kaanholkar (153) | asked Apr 18 '23, 3:18 a.m.
 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


If anyone knows about this then please let me know  .
Thaks in advance

Comments
Ian Barnard commented Apr 18 '23, 4:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Did you try investigating the error message: SSLError("Can't connect to HTTPS URL because the SSL module is not available.") ?


Akash Kaanholkar commented Apr 18 '23, 5:46 a.m.
Thanks Ian ,

But if that SSL Module is the issue then why it is successfully executing in local when executed with "spyder IDE"

Yes , if the SSL Module is not available then it should not execute with spyder as well but executing successfully .

So Ian , is it possible  that it  is due to SSL module not available ?


Ian Barnard commented Apr 18 '23, 6:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

That's what the error message says... I don't suppose it made this up just to confuse you.


Akash Kaanholkar commented Apr 18 '23, 6:32 a.m.
Sorry Ian  I  didn't get what you are saying .
can you please elaborate

Ian Barnard commented Apr 18 '23, 7:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 commented Apr 18 '23, 7:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 commented Apr 18 '23, 7:35 a.m. | edited Apr 18 '23, 7:37 a.m.

Thanks Ian  and Ralph


Ralph Schoon commented Apr 18 '23, 7:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
showing 5 of 8 show 3 more comments

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Apr 20 '23, 3:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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.

Ralph Schoon selected this answer as the correct answer

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.