Skip to content

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

Closed

Description

@684efs3

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

Activity

  1. changed the title [-]RPA Python not working in Mac Monterey[/-] [+]RPA Python not working in MacOS Monterey[/+] on Dec 7, 2021
  2. kensoh commented on Dec 9, 2021

    @kensoh
    Member

    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.

  3. 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[/+] on Dec 9, 2021
  4. 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[/+] on Dec 9, 2021
  5. 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[/+] on Dec 9, 2021
  6. 684efs3 commented on Dec 12, 2021

    @684efs3
    Author

    Fixed - thank you very much!

  7. reopened this on Jan 11, 2022
  8. 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[/+] on Jan 11, 2022
  9. kensoh commented on Jan 19, 2022

    @kensoh
    Member

    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).

  10. added a commit that references this issue on Jan 19, 2022
  11. HollandWeng commented on Dec 16, 2024

    @HollandWeng

    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()

  12. kensoh commented on Dec 26, 2024

    @kensoh
    Member

    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?

  13. HollandWeng commented on Jan 7, 2025

    @HollandWeng

    @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

  14. HollandWeng commented on Jan 7, 2025

    @HollandWeng

    [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

  15. HollandWeng commented on Jan 7, 2025

    @HollandWeng

    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

  16. HollandWeng commented on Jan 10, 2025

    @HollandWeng

    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

  17. kensoh commented on Jan 15, 2025

    @kensoh
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions