TagUI: /usr/bin/env: ‘python’: No such file or directory - update scripts to python3

O/S specifications:

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:        19.10
Codename:       eoan

uname -a

Linux dn00 5.3.0-46-generic #38-Ubuntu SMP Fri Mar 27 17:37:05 UTC 2020 \
x86_64 x86_64 x86_64 GNU/Linux

python --version

Python 3.7.5

php --version

PHP 7.3.11-0ubuntu0.19.10.4 (cli) (built: Apr  8 2020 18:58:29) ( NTS )

Instructions for installation:

https://tagui.readthedocs.io/en/latest/setup.html

ls /usr/local/bin/ | grep tag

tagui

tagui /home/qih/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/tagui/src/tagui_chrome.php on line 34
/usr/bin/env: ‘python’: No such file or directory

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.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (13 by maintainers)

Most upvoted comments

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 😎

@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!!

@ghost, @kensoh

Thank you very much I had the same problem with my Mac M1 pro.

Python 3.9 is preinstalled. Making the change from python to python3 solved it.

Search Tagui codebase

$ cd ~/tagui
$ grep -r /usr/bin/env * | grep python # or
$ grep -r "/usr/bin/env python" *
src/casperjs/tests/clitests/runtests.py:#!/usr/bin/env python
src/casperjs/bin/casperjs:#!/usr/bin/env python
src/slimerjs/slimerjs.py:#!/usr/bin/env python

Remediate

In all 3 files, modify

From: #!/usr/bin/env python To: #!/usr/bin/env python3

Follow up to Issue: /usr/bin/env: ‘python’: No such file or directory.

Drastic Actions:

  • Say 10 ‘Hail Marys’
  • Backup, overwrite sectors & reformat HDD
  • Install Lubuntu 20.04
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

Install TagUI

tagui.readthedocs.io/en/latest/setup.html

Install Curl

sudo apt update && sudo apt install curl

Results:

PHP

$ php --version
PHP 7.4.3 (cli) (built: Mar 26 2020 20:24:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Python3

$ python3
Python 3.8.2 (default, Mar 13 2020, 10:14:16) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Execute TagUI

$ tagui /home/qih/tagui/flows/samples/1_google.tag
/usr/bin/env: ‘python’: No such file or directory

Reoccurence of original issue:

Modify ~/tagui/src/tagui

# Python (2)
# python -u tagui_py/tagui_py.py >> tagui_py/tagui_py.log 2>&1 &
# Python (3)
python3 -u tagui_py/tagui_py.py >> tagui_py/tagui_py.log 2>&1 &

Execute TagUI

$ tagui /home/qih/tagui/flows/samples/1_google.tag
/usr/bin/env: ‘python’: No such file or directory

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

$ cd ~/tagui
$ grep -r /usr/bin/env * | grep python # or
$ grep -r "/usr/bin/env python" *
src/casperjs/tests/clitests/runtests.py:#!/usr/bin/env python
src/casperjs/bin/casperjs:#!/usr/bin/env python
src/slimerjs/slimerjs.py:#!/usr/bin/env python

Remediate

In all 3 files, modify

From: #!/usr/bin/env python To: #!/usr/bin/env python3

Summary:

If your GNU/Linux system uses Python 3, you must modify all instances of ‘python’ to ‘python3’, after that, it works as per design.