Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/local/bin/python3: bad interpreter: No such file or directory for ubuntu 14.04

Hi My python installation is in different directory and i am using a docker image which is mac based and it is referring shebang line as /user/local/bin/python3 from other folder in shell script .

my python installation path

Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/home/myuser/project', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages', '/usr/lib/python3/dist-packages']
>>> 

so is there a way without changing the shebang line i can redirect or link to my installation of python3 to get out of this error.

is it recommended to install python3 in given path. ?

please advice.

like image 238
Karn_way Avatar asked May 15 '16 01:05

Karn_way


1 Answers

If you can't modify the shebang of the file, and you have access to the Dockerfile that creates your docker image, you can add a command directive to create a symbolic link: ln -s /usr/bin/python3 /usr/local/bin/. If you don't have access to the Dockerfile. Then you can run the above command from within the running docker instance. That should solve your issue without having to modify the file.

https://docs.docker.com/engine/reference/builder/#cmd

like image 144
xmonk Avatar answered Sep 18 '22 12:09

xmonk