Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPA Python not working in MacOS Monterey - PHP removed, install PHP this way #335

Closed
684efs3 opened this issue Dec 7, 2021 · 10 comments
Closed
Labels

Comments

@684efs3
Copy link

684efs3 commented Dec 7, 2021

I just upgraded to MacOS Monterey and my previous RPA Python code no longer works. I am using RPA to open a website and now I get this:

I am using a Jupyter notebook.

import rpa as r

r.init(visual_automation = True)
r.url('https://www.yahoo.com')
r.close()

[RPA][ERROR] - following happens when starting TagUI...


[RPA][ERROR] - use init() before using url()
[RPA][ERROR] - use init() before using close()
False
@684efs3 684efs3 changed the title RPA Python not working in Mac Monterey RPA Python not working in MacOS Monterey Dec 7, 2021
@kensoh
Copy link
Member

kensoh commented Dec 9, 2021

Hi @684efs3, thanks for reporting this!

I'm seeing reports of this issue, due to the new macOS version removing PHP -
https://www.techgenyz.com/2021/06/18/macos-12-monterey-update-built-in-php/

Solution for now is to install PHP manually, unless this can be automated (I don't think so, need password to run homebrew) or co-packaged. Below will install Homebrew package manager, then install PHP which is required to run the rpa package.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install php

Try the above to see if that works. I'm using Mac as well but am still keeping it at Catalina version so I can't replicate.

@kensoh kensoh added the bug label Dec 9, 2021
@kensoh kensoh changed the title RPA Python not working in MacOS Monterey RPA Python not working in MacOS Monterey - PHP has been removed, try this to install PHP Dec 9, 2021
@kensoh kensoh changed the title RPA Python not working in MacOS Monterey - PHP has been removed, try this to install PHP RPA Python not working in MacOS Monterey - PHP is removed, try this to install PHP Dec 9, 2021
@kensoh kensoh changed the title RPA Python not working in MacOS Monterey - PHP is removed, try this to install PHP RPA Python not working in MacOS Monterey - PHP has been removed, install PHP this way Dec 9, 2021
@684efs3
Copy link
Author

684efs3 commented Dec 12, 2021

Fixed - thank you very much!

@684efs3 684efs3 closed this as completed Dec 12, 2021
@kensoh kensoh reopened this Jan 11, 2022
@kensoh kensoh changed the title RPA Python not working in MacOS Monterey - PHP has been removed, install PHP this way RPA Python not working in MacOS Monterey - PHP removed, install PHP this way Jan 11, 2022
@kensoh
Copy link
Member

kensoh commented Jan 19, 2022

Adding a note that upstream TagUI has a fix for newer PHP (eg v8.1.1) which has some problem with the code used to process datatables and object repositories. However, this is not needed here because for the Python package, those blocks of code are never executed (no concept of datatables or object repositories here).

@HollandWeng
Copy link

what i should do with the @kensoh
first ,i have donwload php this is th version

(Machine_Learning) @macbook-pro ~ % php -v
PHP 8.4.1 (cli) (built: Nov 20 2024 09:48:35) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.1, Copyright (c) Zend Technologies
with Zend OPcache v8.4.1, Copyright (c), by Zend Technologies

scond,i download java and amazon corretto
then i run my code;

[RPA][ERROR] - following happens when starting TagUI...

The following command is executed to start TagUI -
"/Users//.tagui/src/tagui" rpa_python chrome

It leads to following output when starting TagUI -
/Users//.tagui/src/tagui: line 256: php: command not found
Unable to open file: /Users/hollandweng/Documents/PythonCode/RPA/rpa_python.js

phantomjs://code/bootstrap.js:113 in __die
Unable to load script /Users//Documents/PythonCode/RPA/rpa_python.js; check file syntax

phantomjs://code/bootstrap.js:113 in __die

[RPA][ERROR] - unknown error encountered
[RPA][ERROR] - following happens when starting TagUI...

The following command is executed to start TagUI -
"/Users//.tagui/src/tagui" rpa_python chrome

It leads to following output when starting TagUI -
/Users/hollandweng/.tagui/src/tagui: line 256: php: command not found
Unable to open file: /Users//Documents/PythonCode/RPA/rpa_python.js

phantomjs://code/bootstrap.js:113 in __die
Unable to load script /Users//Documents/PythonCode/RPA/rpa_python.js; check file syntax

phantomjs://code/bootstrap.js:113 in __die

[RPA][ERROR] - unknown error encountered
[RPA][ERROR] - use init() before using url()
[RPA][ERROR] - use init() before using present()

@kensoh
Copy link
Member

kensoh commented Dec 26, 2024

Hi @HollandWeng I've not come across this situation. The error message says php conmand is not found but you have installed it. Can you try going to the .tagui/src folder and type php to see if the command can be accessed there?

@HollandWeng
Copy link

@kensoh Thanks for your reply, I open .tagui/src and search for php, get the following result.
BadOpcodeException.php
BadUriException.php
Base.php
Client.php
ConnectionException.php
Exception.php
sleep.php
tagui_chrome.php
tagui_helper.php
tagui_parse.php
tagui_report.php
tagui_runner.php
tagui_service.php
translate.php
transpose.php.

These files are in that folder,what should I do next? Thank you very much

@HollandWeng
Copy link

[RPA][ERROR] - following happens when starting TagUI...

The following command is executed to start TagUI -
"/Users/hollandweng/.tagui/src/tagui" rpa_python chrome

It leads to following output when starting TagUI -
ERROR - cannot find Chrome at "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
Chrome is at a non-standard location on your macOS, raise an issue on TagUI GitHub page

[RPA][ERROR] - unknown error encountered
[RPA][ERROR] - following happens when starting TagUI...

The following command is executed to start TagUI -
"/Users/hollandweng/.tagui/src/tagui" rpa_python chrome

It leads to following output when starting TagUI -
ERROR - cannot find Chrome at "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
Chrome is at a non-standard location on your macOS, raise an issue on TagUI GitHub page

[RPA][ERROR] - unknown error encountered
[RPA][ERROR] - use init() before using url()
[RPA][ERROR] - use init() before using present()

these kind of error occur when I run my code today @kensoh

@HollandWeng
Copy link

I also found that I have download 2 kinds of java(jdk) by mistake, one is from amazon-corretto, and another is from Oracle Corporation. Do I need to delete java or is just have something wrong with PHP ? @kensoh
/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

@HollandWeng
Copy link

After I download google chrome, it seems that I can run my rpa code, but the Java icon appearing in the Dock while I'm running a program, is this because I've installed two Java environments, or is it a normal situation? @kensoh

@kensoh
Copy link
Member

kensoh commented Jan 15, 2025

Hi @HollandWeng it looks like you solved the issue. For Java icon yes this is normal, the package uses SikuliX for visual automation and physical keyboard automation. If you use those type of automation in your script, Java will launch because SikuliX is a Java program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants