1

When I run docker-compose up

I get the error

zsh: /home/emil/.local/bin/docker-compose: bad interpreter: /home/linuxbrew/.linuxbrew/Cellar/python@2/2.7.16/bin/python: no such file or directory

I checked which python and I get /home/linuxbrew/.linuxbrew/bin/python

I tried to system link

➜ 2.7.16 ln -s /home/linuxbrew/.linuxbrew/bin/python home/linuxbrew/.linuxbrew/Cellar/python@2/2.7.16/bin/python ln: failed to create symbolic link 'home/linuxbrew/.linuxbrew/Cellar/python@2/2.7.16/bin/python': No such file or directory ➜ 2.7.16 ln -s home/linuxbrew/.linuxbrew/Cellar/python@2/2.7.16/bin/python /home/linuxbrew/.linuxbrew/bin/python ln: failed to create symbolic link '/home/linuxbrew/.linuxbrew/bin/python': File exists

At the moment linux brew python installation is at 2.7.16_1 folder not 2.7.16. How do I fix this ? I want to create link so whenever it looks for python at 2.7.16/bin/python it should rather look into 2.7.16_1/bin/python.

Is this even possible ?

And how can I solve this, any ideas ? I tried uninstalling and reinstalling docker and python.

frank3stein
  • 706
  • 2
  • 7
  • 16

2 Answers2

0

When installing a formula via brew it will symlink necessary binaries to a bin directory that's on your PATH. Try re-linking the formula:

brew link --overwrite python

Otherwise, it appears the docker-compose formula depends on python 3.

jcragun
  • 2,060
  • 10
  • 8
  • This did not work. I did use linuxbrew to install docker-compose but python. So it gave me the idea to try that. – frank3stein Oct 19 '19 at 01:26
0

I found the solution.

I uninstalled docker apt remove docker as it is suggested at their website

sudo apt-get remove docker docker-engine docker.io containerd runc

then I had installed docker and docker-compose using linuxbrew.

But it was still somehow using the /home/username/.local/bin/docker-compose, so I deleted it. I figured that once i ran docker-compose, it gave the same error but also ran successfully. Somehow it was running both of the executables.

So I just rm /home/username/.local/bin/docker-compose and it was fixed.

frank3stein
  • 706
  • 2
  • 7
  • 16