-
Notifications
You must be signed in to change notification settings - Fork 596
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
/usr/bin/env: ‘python’: No such file or directory - update scripts to python3 #792
Comments
Hi @QuiParses are you running TagUI with the qih user? Above error message The few lines of code in tagui/src/tagui_chrome.php that trigger the error message - // initialise interface in-file before starting main loop
file_put_contents('tagui_chrome.in','');
// main loop to scan inputs from automation flow
echo "[tagui] START - listening for inputs\n\n"; while (true) {
// scan input from run-time interface in-file
$tagui_intent = trim(file_get_contents('tagui_chrome.in')); |
Yes, the main system $usr, 'qih'. I unzipped the tagui.zip and created the dir/ & symlink as the same user so there should be no permissions issues. Also installed PHP_Latest usin 'sudo ...' too. Odd.
21 Apr 2020, 17:02 by [email protected]:
…
Hi > @QuiParses <https://github.com/QuiParses>> are you running TagUI with the qih user?
Above error message > No such file or directory in /home/qih/tagui/src/tagui_chrome.php> is suggesting that for some reason TagUI does not have permission to create that file on your computer. Below more details, just simple writing and reading from a dummy file.
The few lines of code in tagui/src/tagui_chrome.php that trigger the error message -
//> initialise interface in-file before starting main loop> file_put_contents> (> '> tagui_chrome.in> '> ,> '> '> );> //> main loop to scan inputs from automation flow> echo> > "> [tagui] START - listening for inputs> \n\n> "> ; > while> (> true> ) {> //> scan input from run-time interface in-file> $tagui_intent> > => > trim> (> file_get_contents> (> '> tagui_chrome.in> '> ));
—
You are receiving this because you were mentioned.
Reply to this email directly, > view it on GitHub <#792 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/AOGJ2PKEUHQFERYB2GXPQC3RNUSEVANCNFSM4MM7HFHQ>> .
|
For the error message |
For user permissions, try doing a |
Sorry for delay, redoing, testing etc.
OK: did as you said ...
$ chmod -R 777 /home/qih/tagui
qih@dn00 ~/tagui $ ll
total 36
drwxrwxrwx 4 qih qih 4096 Mar 10 21:37 .
drwxr-xr-x 31 qih qih 4096 Apr 21 16:10 ..
drwxrwxrwx 3 qih qih 4096 Mar 10 06:14 flows
-rwxrwxrwx 1 qih qih 11343 Mar 10 06:14 LICENSE.md
-rwxrwxrwx 1 qih qih 572 Mar 10 06:14 package.json
-rwxrwxrwx 1 qih qih 2926 Mar 10 06:14 README.md
drwxrwxrwx 15 qih qih 4096 Apr 21 17:09 src
$ tagui ~/tagui/flows/samples/1_google.tag
qih@dn00 ~ $ tagui ~/tagui/flows/samples/1_google.tag
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
/usr/bin/env: ‘python’: No such file or directory
If I am in ~/tagui & execute that cmd, I get the Python error again.
If I am in ~/ & execute that cmd, I get the above PHP-related error.
21 Apr 2020, 17:07 by [email protected]:
…
For user permissions, try doing a > chmod -R 777 /home/qih/tagui> to make all files and directories full permissions, and try running again to see if it works. If it works, that means something wrong with the permissions assigned to some of the files or folders there.
—
You are receiving this because you were mentioned.
Reply to this email directly, > view it on GitHub <#792 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/AOGJ2PK3NPWLSJWEWVQ4HWLRNUSYNANCNFSM4MM7HFHQ>> .
|
try this -
If it works, it could be the way you do the symbolic link is not working and TagUI isn't launched from the correct working directory. If it doesn't work, it could be some strange behaviour on Ubuntu on running scripts and their working directory, which isn't discovered before. |
Went back and checked this. I have Python3 installed, so executing 'python' produces an error. Python3 gives me the Py3 REPL as expected.
qih@dn00 ~ $ cd tagui/src/tagui_py/
qih@dn00 ~/tagui/src/tagui_py $ ls
tagui_py.log tagui_py.py tagui_py_windows.log
21 Apr 2020, 17:05 by [email protected]:
…
For the error message > /usr/bin/env: ‘python’: No such file or directory> , TagUI will run the command > python> if it detects that Python is used in your automation. From above 1_google.tag it does not use Python, but not sure why Python is called. You can check 2 things, try typing > python> from the same user terminal that you type tagui command to see if Python is launched. Next is check whether there is a file tagui/src/tagui_py/tagui_py.in file. There shouldn't be this file there if Python is not required in the automation script.
—
You are receiving this because you were mentioned.
Reply to this email directly, > view it on GitHub <#792 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/AOGJ2PLFNFO3K62BYP45K5LRNUSSRANCNFSM4MM7HFHQ>> .
|
If
to
But don't think this is the cause of the problem, because the Google sample does not need Python at all, so it shouldn't even try to launch python command. |
$ cd /home/qih/tagui/src
$ pwd
/home/qih/tagui/src
./tagui ../flows/samples/1_google.tag -n
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to open stream: No such file or directory in /home/qih/tag
ui/src/tagui_chrome.php on line 34
PHP Warning: file_get_contents(tagui_chrome.in): failed to o
... continuous. Even Ctrl-C does not stop it, I have to crash the Terminal process.
21 Apr 2020, 17:20 by [email protected]:
…
try this -
cd /home/qih/tagui/src./tagui ../flows/samples/1_google.tag -n
If it works, it could be the way you do the symbolic link is not working and TagUI isn't launched from the correct working directory. If it doesn't work, it could be some strange behaviour on Ubuntu on running scripts and their working directory, which isn't discovered before.
—
You are receiving this because you were mentioned.
Reply to this email directly, > view it on GitHub <#792 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/AOGJ2PPOPUGI23FAG2SCNV3RNUUIBANCNFSM4MM7HFHQ>> .
|
Progress!
qih@dn00 ~ $ tagui ~/tagui/flows/samples/1_google.tag
/usr/bin/env: ‘python’: No such file or directory
... but no other errors. I just checked ~/tagui/src/tagui again, and there are no other instances of 'python' as executables. So I am guessing something else is being invoked at the same time?
21 Apr 2020, 17:23 by [email protected]:
…
If > python> command is not available on your system, try modifying tagui\src\tagui and change the line
python -u tagui_py/tagui_py.py
to
python3 -u tagui_py/tagui_py.py
But don't think this is the cause of the problem, because the Google sample does not need Python at all, so it shouldn't even try to launch python command.
—
You are receiving this because you were mentioned.
Reply to this email directly, > view it on GitHub <#792 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/AOGJ2PL7J64TXQI7AMVH76LRNUUV5ANCNFSM4MM7HFHQ>> .
|
Try running this -
That command kills all TagUI-related dead processes. It could be for some reason, there is some dead TagUI processes that is messing up when you try to run |
OK did that, still not working as per spec.
I have redone it all again twice, and then implemented your suggestions, with the same result.
Just now:
qih@dn00 ~ $ sudo ln -sf /home/qih/tagui/src/tagui /usr/local/bin/tagui
qih@dn00 ~ $ cd /home/qih/tagui/src
qih@dn00 ~/tagui/src $ ./end_processes
qih@dn00 ~/tagui/src $ ls
casperjs media tagui_chrome.php tagui_helper.php tagui.sikuli
chrome phantomjs tagui.cmd tagui_parse.php test
end_processes samples tagui_config.txt tagui_py translate.php
end_processes.cmd sikulix tagui_crontab tagui_r transpose.php
erina sleep.php tagui_footer.js tagui_report.php ws
erina.cmd slimerjs tagui_global.csv tagui_runner.php
languages tagui tagui_header.js tagui_service.php
qih@dn00 ~/tagui/src $ nano tagui
qih@dn00 ~/tagui/src $ which python
qih@dn00 ~/tagui/src $ which python3
/usr/bin/python3
qih@dn00 ~/tagui/src $ cd /home/qih/tagui/src
qih@dn00 ~/tagui/src $ ./tagui ../flows/samples/1_google.tag -n
/usr/bin/env: ‘python’: No such file or directory
21 Apr 2020, 17:53 by [email protected]:
…
Try running this -
cd /home/qih/tagui/src./end_processes
That command kills all TagUI-related dead processes. It could be for some reason, there is some dead TagUI processes that is messing up when you try to run > tagui> on the sample.
—
You are receiving this because you were mentioned.
Reply to this email directly, > view it on GitHub <#792 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/AOGJ2PP5AANAUJAULBB2G3TRNUYE5ANCNFSM4MM7HFHQ>> .
|
Deleted tagui*; reboot, cp & unzip Tagui*.zip
Execute again
Execute the command directly
End Processes
I also went through the ~/tagui/flow/samples* 1 by 1, to verify that there was no Python call hidden in there, which of course there was not. It is acting as if it does not see Python3? |
ProgressModify ~/tagui/src/tagui Chrome string
Python string
Execute
|
Hi @QuiParses thanks for all the troubleshooting details and logs! I've looked through your details carefully, and I'm afraid I have no idea why above bizarre error is happening. Since you have already changed the Python command to python3 and you still get the python not found error. I'm assuming that you are running a real Linux and not a Linux shell within Windows. If so, can you try look for another computer with Linux that you can try to see if the same error happens? Maybe your personal laptop or borrow your colleague or friend laptop. If the other computer you cannot replicate the error, then compare the OS settings between the 2 computers to figure out what could be the cause of the problem. I'm recommending you try another laptop as you have already traced very deeply and looking further in this track is likely to waste your time without any new clues. |
Also, I have not received any report of such an error by any TagUI user (there are over 1k users using it on Linux), so there isn't more data points from my experience what could have caused this bizarre error. Since the TagUI source code is the same, but error is only happening on your laptop, I suspect that the more likely reason is some unique OS or environment configuration that is the root cause. |
Thanks for the update. I am using Kubuntu on a Desktop Machine but with a 'standard' install. I even went as far as to disable ~/.bash_aliases in case one of the Python aliases was causing an issue. I am planning to wipe this HDD and reinstall anyway, plus I will configure Tagui on one of my Raspberry Pi (Which run Python 2.7 by default) as an extra test. Thanks for all your help & patience. |
You're welcome @QuiParses, hope there is some good results soon! I'll close this issue for the time being, pending further inputs from your investigation. |
Follow up to Issue: /usr/bin/env: 'python': No such file or directory.Drastic Actions:
Install TagUI
Install Curl
Results:PHP
Python3
Execute TagUI
Reoccurence of original issue:Modify ~/tagui/src/tagui
Execute TagUI
Logic dictates that there must be other references to 'python' within the codebase that are getting called and causing this error, therefore must find these instances. Search Tagui codebase
RemediateIn all 3 files, modify From: Summary:If your GNU/Linux system uses Python 3, you must modify all instances |
Hi @QuiParses that is very detailed and excellent detective work you have there! Thanks for sharing your findings. Yes the file that breaks this would be this -
TagUI is built on CasperJS, and for the macOS / Linux environments, CasperJS uses Python as entry point to run its code. It's been 3 years since I first wrote the integration with CasperJS, and I've forgot about that when you raise the issue. I'm sorry about that. Changing the I'll close the issue for now. And see if there are more cases of such setups, then I'll update documentation or find other ways to remove this friction for such scenarios. Thanks! |
Adding on, I suspect that instead of changing the files, symbolic linking of below -
to the python3 command in your environment may also do the trick as |
Personally, if a newb to GNU/Linux was doing this, perhaps it might be better to be able to modify the TagUI codebase depending on Python ver 2 /3,rather than editing a system wide ENV like 'Python'. I'll hack up a BASH/DASH script that will detect the OS.Python.ver and modify those Shebang strings. Might take a few days 8-) |
Modifying this way is ok, it is not a system-wide environment variable. It is creating a symbolic link for |
Thank you very much I had the same problem with my Mac M1 pro. Python 3.9 is preinstalled. Making the change from
Remediate In all 3 files, modify From: #!/usr/bin/env python |
Thanks @pp082 for sharing this solution here! 😄 |
@kensoh @pp082 @ghost It really helps me a lot!! Because in the later version of OS(It is macOS 13.3.1 (a) now), I find it hard to create a symbolic link for python from python3 after the upgrade of the system protection(the SIP and when trying to edit the permission of root file another error occurs like: "/data: Read-only file system") and I suffer it for a whole day!!! THANKS!! |
O/S specifications:
lsb_release -a
uname -a
python --version
php --version
Instructions for installation:
https://tagui.readthedocs.io/en/latest/setup.html
ls /usr/local/bin/ | grep tag
tagui /home/qih/tagui/flows/samples/1_google.tag
On execution of the above 'tagui command, the Chrome Browser briefly renders an instance of the UI then crashes, with no further error message at STDOUT.
I 'rm -rf' the ~/tagui and redid the process exactly same, with the same result.
The text was updated successfully, but these errors were encountered: