Need help opening jupyter notebook from uipath

Hi all, i have jupyter notebook installed in my laptop. However, when i tried to programme the robot to open it up via “open application”, it does not work. There is no error but my jupyter notebook doesn’t open up. Anyone able to help me?

@miriam_ong

Do you have Anaconda installed?

Hi @miriam_ong,

Alternatively you could use the invoke powershell activity.

In your powershell script,

You can first navigate to the folder where you want jupyter notebook to use as root.
cd fullpathProjectfolder

If that root project folder also has a virtual environment activate it in the script
NameVirtualEnv/scripts/activate (in windows)

Ignore last step, if you want to use the jupyter module installed on the system (not virtual environment)

Final line of the script: jupyter notebook

In UiPath attach to the opened jupyter notebook instance. From there in its standard browser automation.

Hope this helps your cause.

Yes i have anaconda installed on my laptop

will you be able to show me what do i type as the powershell script? cd fullpathProjectfolder → do i put this under command text? and where do i put the file path name?

Hi @miriam_ong

Use Invoke Powershell Activity to open the jupyter notebook. Use the command given below

"C:\Users\userName\Anaconda3\pythonw.exe C:\Users\userName\Anaconda3\cwp.py C:\Users\userName\Anaconda3 C:\Users\userName\Anaconda3\pythonw.exe C:\Users\userName\Anaconda3\Scripts\jupyter-notebook-script.py"

Please replace userName with the your user name.
No other property is required to be set.

Hi again @miriam_ong,

I do not have jupyter currently installed so I cannot guide you further with “Attach Browser”, but this script will work in UiPath, you will have to change the folder path, ignore the .replace if you give the correct folder path.

$YourProjectFolder =  'C:\Users\USER\Downloads\'.Replace('USER', $env:UserName)
cd  $YourProjectFolder

try{ 
     jupyter notebook
    $out_Message = 'Jupyter notebook opened'}
catch {
   $out_Message = 'An error occurred: ' + $_
   }

$out_Message

This script will send a message back saying whether jupyter notebook has opened, which you can use to attach the browser using "Attach Browser" activity.

The script does the same steps I mentioned in the earlier post but with some success / failure message strings.

$_ returns the error message in PowerShell in the catch block
The type argument in Invoke PowerShell activity needs to be a string and IsScript needs to be checked as shown below.

Sample workflow:
OpenJupyterNotebook.xaml (6.2 KB)

Hope this helps.

Hi @miriam_ong ,

You can also use hotkey to open run command and pass the path where Jupiter instance present.

1 Like

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