Error initializing Python engine -> RemoteException wrapping System.Exception: Host process has exit!

Hi Team,

I am unable to run my python script using python scope. i have tried all the discussion forums present but no luck. Could someone throw work around for the same.
Below steps I have tried:

  1. I have installed Python 3.13 and run my script through command, worked as expected.
  2. I have tried same script to run with Python scope in UiPath with below details
    Python Package Version : 1.9.0
    I have given Library Path, Path, Version selected : >=3.10

Local Error : Error initializing Python engine → RemoteException wrapping System.Exception: Host process has exit!
Output Error : Python Scope: Error initializing Python engine

  1. I have downgraded UiPath version to 1.8.0 and run the code then the studio is getting struck and no error, no bot execution completed it keep on executing until we stop

Next Steps:

  1. I have downgraded the python package to lower version to 3.11 and UiPath python package to 1.7.1, 1.8.0
  2. This time when I tried running in debug mode and normal mode, it got struck and keep on executing mode still we stop, it is executing only, neither it is stopped nor thrown any error.

Either of the ways my code is not executing through python scope.
Note:

  1. I have tried all the forums but no luck
  2. I ma reading script from py file, passed correct library(dll path), Path(installation path), version(>=3.10).

@loginerror @Anil_G @marian.platonov @UiPath_Community
Thanks in Advance

@satishmypudi,

The error saying that you don’t have the required .Net Runtime installed on your machine.

Install it from here and restart the system and try.

@satishmypudi

  1. Currently the macimum supported version of python is 3.12 …so 3.13 you would get an issue
  2. Now coming to 3.11 version issue…if the python UiPath package is 1.8 or below you need .net runtime 5 to be installed …if 1.9 or above .net runtime 6 to be installed. So please install them accordingly based on package version you use
  3. Also make sure no multiple python versions are installed on the system

Cheers

Hi @ashokkarale / @Anil_G
First i would like to thank both of you for giving workaround which helped me to resolve above mentioned(python scope) issue. Now, I am facing another issue.
I have tried to execute my python script through both load python and run python activities

Observations:

  1. with Load python script, the activity is successfully executing but not writing any output. Usually if my script is executed, it will generate some token in notepad file, the file is available in the same directory of the code (this working fine when I run through CMD).
  2. If I use Run python script, i am getting below error.

Error:

Could you please guide/help me what is the wrong workaround I am doing?

@satishmypudi

Glad it helped

Do you have multiple instances of python?

Also try to run a simple script first to check if it is working proper

Generally piep is broken comes when .net is wrong version or the imports dont work…

Depending on the python package version please check the compatible versions…also try using latest package

Also if output is writtent to notepad then what is the jwt_token variable you are using for?

Cheers

@satishmypudi,

To what file path your python script is saving the text file?

Try using the same path as you would have provided WorkingFolder in Python Scope activity

Hi @Anil_G
As suggested I am using python = 3.12 version and UiPath python activity version = 1.9

There are no multiple instances only one(3.12)
Also installed latest .net 6 version provided by @ashokkarale

that jwt_token is dummy variable, you can ignore, i forgot to remove it… sry :slight_smile:

@satishmypudi

after load you need to use invoke python method to start the method

and if you are using run then if you give a def or function it cannot trigger…you need to give the code directly or the execute def also should be called inside the file or code itself

cheers

Hi @Anil_G / @ashokkarale

sorry for the delay… I am able to resolve issue with one workaround for now it is working for me.

The issue is main with the UiPath compatibility as well as code changes.

Observations:

  1. In my python code, i have written code to take path dynamic(current directory) and no hardcoded values has given.
    If I am running the code it is able to run properly with CMD where as I am getting issues in python activities saying pipe broken error(for both Run script & load script activities).

  2. If I used hardcoded values in my script and then if I try with Run script activity it worked fine and no issues.
    The same script with hardcoded values if I try to run with load script activity, I am able to get the output for load script but unable to invoke any method(all required values passed), even though the method is present in script, Always getting Pipe broken error.

WorkAround:

  1. I have installed .net 6 version
  2. I have degraded to python 3.12 version given library path, path and selected >=3.10 version for python scope
  3. I used write text file activity to write my code and pass the variables dynamic and then convert to python file and passed as input to Run script python file which it will create my output file.

Thanks for all the help @ashokkarale & @Anil_G
@UiPath_Community : Please check if this is known issue from UiPath end. I am able to run script, if my script is having hardcoded values. but I am not able to run if I am making my script to take dynamic paths.

2 Likes

@satishmypudi

The current directory path might differ when you run from cmd and UiPath…try to log and check…also if you need dynamic paths…you can add an argument to your code and pass the value from UiPath …so in UiPath you can get the current directory and pass it as argument input to python script which can be used in the code…

Also if you can share a sample code we can check from our end too

Cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.