Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

zsh: ../configure: bad interpreter: /usr/bin/python: no file or directory #234

Open
hiren3897 opened this issue May 12, 2022 · 15 comments
Open

Comments

@hiren3897
Copy link

hiren3897 commented May 12, 2022

I have python3 in my MacOS in /usr/bin/python3 v3.9 no supported by shaka-player embedded for now

but I have python v2.7 in /usr/local/bin/python

when I run ../configure it says zsh: ../configure: bad interpreter: /usr/bin/python: no file or directory

Can you guide me on how should I configure it so it points to /urs/local/bin/python
Or any PATH config to make python2.7 in /usr/local/bin/python should appear in /usr/bin/python*

@joeyparrish
Copy link
Member

I think you'd have to do something like git grep /usr/bin/python and take instances like this:

#!/usr/bin/python

And replace them with this:

#!/usr/bin/env python

If you get this working, please send a PR!

@hiren3897
Copy link
Author

hiren3897 commented May 16, 2022

Hello, Thanks for the response

This didn't worked for me

#!/usr/bin/env python

This worked for me

#!/usr/bin/python3

But now I am facing an error while configuring and building the SDK
You can see the error in the following screenshot.
errorSE

It seems to be a python indentation problem in the file of boringssl

Could you please suggest to me how I can resolve this ?
I tried to fix the indentation but when I do again ../configure then it again gives the same error

@joeyparrish
Copy link
Member

Then #!/usr/bin/env python3 is the way to do it. This is more general than #!/usr/bin/python3, because it allows python3 to be anywhere in your $PATH environment variable.

As for the other issue, that's not indentation. In Python 3, print is a function rather than a statement. For example:

    print('export %s="%s"' % (key, value))

But that file (in third_party/boringssl) is coming from another repository through a git submodule. You will need to update the submodule to get a newer version of boringssl that has adopted Python 3.

@hiren3897
Copy link
Author

hiren3897 commented May 17, 2022

Thanks @joeyparrish

Yes! I have changed it to #!/usr/bin/env python3 which works fine.

I updated that submodule URL of boringssl form https://boringssl.googlesource.com/boringssl to https://github.com/google/boringssl.git in .gitmodules but it still clones the old repo and not the new one from https://github.com/google/boringssl.git :(

I tried to update the submodule but it is still the same when I run ../configure --ios again then it still keeps the old version of boringssl

subprocess.check_output(

This line always updates the submodule I guess!

@joeyparrish
Copy link
Member

It's not the URL that needs updating, but the git reference (SHA1) to pull.

@hiren3897
Copy link
Author

hiren3897 commented May 17, 2022

Hello @joeyparrish
Happy Day

Can you please explain to me a bit how should I do that I have been waiting for your reply as I spent my whole day fixing this?

because I did check out the boringssl and pulled everything from the master branch but when I do ../configure it clone the same old repo :( again and I have the error

@hiren3897
Copy link
Author

hiren3897 commented May 17, 2022

Can you please help me in resolving this error! It would be a great help for me.

So that I will be able to build the SDK and start developing the app

As I have tried all the possible ways to do it.

Please

On boringssl it shows HEAD detached at 35b4a1225 when I do git status

@hiren3897
Copy link
Author

I did git config -f .gitmodules submodule.third_party/boringssl/src.branch master then git submodule update --remote

then when I do ../configure it again fetches the old repo code and gives me the error

is there a flag to stop the already cloned repos?

@joeyparrish
Copy link
Member

In a nutshell, go to the submodule folder, which has its own ".git" and everything, then git pull and checkout a newer revision (main, a certain version, whatever). Then go back to the shaka-player-embedded repo and you can "commit" the change in submodule revision.

See also the docs on submodules: https://git-scm.com/book/en/v2/Git-Tools-Submodules
You may also find more concise advice on submodules here: https://www.google.com/search?q=git+submodule+cheat+sheet

@hiren3897
Copy link
Author

hiren3897 commented May 17, 2022

yes was also able to do with git submodule update --remote and then commit from the shaka-player-embedded repo but now it gives a weird error of No such file or directory: 'go' in boringssl/src/util/generate_build_files.py line 867 :(

I see a go directory in util/bot/go

@joeyparrish
Copy link
Member

Then perhaps something about the way the shaka-player-embedded build system builds/configures boringssl needs to be updated to match the newer version of boringssl. Sorry I don't have anything more specific to offer. You may want to dig through the source of both projects.

@hiren3897
Copy link
Author

I was able to install python 2.7.18 in macOS Monetary and was not having the previous errors

but now I am interrupted with the new error

Downloading... 100%
INFO:bootstrap:Extracting...
INFO:bootstrap:Validating...
INFO:bootstrap:Removing /Users/hrathod/Desktop/MyWork/ShakaPlayer iOS SDK/shaka-playerembedded/
third_party/boringssl/src/util/bot/golang/tmpRkBYQa
Traceback (most recent call last):
File "/Users/hrathod/Desktop/MyWork/ShakaPlayer iOS SDK/shaka-player-embedded/
third_party/boringssl/src/util/bot/go/env.py", line 34, in <module>
new = bootstrap.prepare_go_environ()
File "/Users/hrathod/Desktop/MyWork/ShakaPlayer iOS SDK/shaka-player-embedded/
third_party/boringssl/src/util/bot/go/bootstrap.py", line 266, in prepare_go_environ
bootstrap(logging.INFO)
File "/Users/hrathod/Desktop/MyWork/ShakaPlayer iOS SDK/shaka-player-embedded/
third_party/boringssl/src/util/bot/go/bootstrap.py", line 258, in bootstrap
ensure_toolset_installed(TOOLSET_ROOT)
File "/Users/hrathod/Desktop/MyWork/ShakaPlayer iOS SDK/shaka-player-embedded/
third_party/boringssl/src/util/bot/go/bootstrap.py", line 199, in ensure_toolset_installed
install_toolset(toolset_root, available)
File "/Users/hrathod/Desktop/MyWork/ShakaPlayer iOS SDK/shaka-player-embedded/
third_party/boringssl/src/util/bot/go/bootstrap.py", line 140, in install_toolset
if not check_hello_world(toolset_root):
File "/Users/hrathod/Desktop/MyWork/ShakaPlayer iOS SDK/shaka-player-embedded/
third_party/boringssl/src/util/bot/go/bootstrap.py", line 177, in check_hello_world
stderr=subprocess.STDOUT)
File "/Users/hrathod/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 223, in
check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/Users/hrathod/Desktop/MyWork/ShakaPlayer iOS
SDK/shaka-player-embedded/third_party/boringssl/src/util/bot/golang/go/bin/go', 'run', '/Users/
hrathod/Desktop/MyWork/ShakaPlayer iOS SDK/shaka-player-embedded/third_party/boringssl/
src/util/bot/golang/tmpRkBYQa/hello.go']' returned non-zero exit status 1

Is it because of python version 2.7.18 where subprocess.py raise the error ?

@fyanyan
Copy link

fyanyan commented Jun 2, 2022

Have you solved your problem?

@hiren3897
Copy link
Author

Not yet! We have to make all the third-party libs plus the main Shaka-embedded compatible with the latest python version.

which is really very complex to do for me because of having no prior experience in Objective C

@naval77
Copy link

naval77 commented Jun 11, 2022

INSTALL 2 version pf python 2.7.18 and 3 when You configure use pyhton2.7 and for make python3 .
Simply create ln -sh /usr/bin/python2.7 pyhton
and same for pyhton 3
It will solve all python related issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants