# Brew link step failing on Python dependency

**URL:** <https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925>\
**Category:** Build Environment\
**Created:** [December 30, 2019, 3:01pm UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925 "2019-12-30T15:01:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdm](https://avatars.discourse-cdn.com/v4/letter/j/90db22/32.png) [@jdm](https://discuss.circleci.com/u/jdm)\
**Post date:** [December 30, 2019, 3:01pm UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/1 "2019-12-30T15:01:22Z")

</div>

running “brew update && brew install imagemagick” on a xcode: `11.3.0` build is having the following issue when installing python as a dependency of imagemagick.

This has started just recently without changes on my end, and from what I can tell, imagemagick hasn’t had any changes related to this.

I’ve gone through some of the brew python documentation, but not sure exactly what the right next step is…

==\> Pouring python-3.7.6.catalina.bottle.tar.gz  
Error: The `brew link` step did not complete successfully  
The formula built, but is not symlinked into /usr/local  
Could not symlink Frameworks/Python.framework/Headers  
Target /usr/local/Frameworks/Python.framework/Headers  
is a symlink belonging to python@2. You can unlink it:  
brew unlink python@2

To force the link and overwrite all conflicting files:  
brew link --overwrite python

To list all files that would be deleted:  
brew link --overwrite --dry-run python

Possible conflicting files are:  
/usr/local/Frameworks/Python.framework/Headers -\> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Headers  
/usr/local/Frameworks/Python.framework/Python -\> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Python  
/usr/local/Frameworks/Python.framework/Resources -\> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Resources  
/usr/local/Frameworks/Python.framework/Versions/Current -\> /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/Current  
==\> /usr/local/Cellar/python/3.7.6/bin/python3 -s setup.py --no-user-cfg install  
==\> /usr/local/Cellar/python/3.7.6/bin/python3 -s setup.py --no-user-cfg install  
==\> /usr/local/Cellar/python/3.7.6/bin/python3 -s setup.py --no-user-cfg install  
==\> Caveats  
Python has been installed as  
/usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to  
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into  
/usr/local/opt/python/libexec/bin

If you need Homebrew’s Python 2.7 run  
brew install python@2

You can install Python packages with  
pip3 install   
They will install into the site-package directory  
/usr/local/lib/python3.7/site-packages

See: [https://docs.brew.sh/Homebrew-and-Python](https://docs.brew.sh/Homebrew-and-Python)

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [December 30, 2019, 9:50pm UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/2 "2019-12-30T21:50:40Z")

</div>

Could you add some backticks to your post, to make it readable?

````
```
your console output here
```

````

Thanks! 👍

---

<div class="post-metadata">

**Author:** ![dhutch](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@dhutch](https://discuss.circleci.com/u/dhutch)\
**Post date:** [January 3, 2020, 10:38am UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/3 "2020-01-03T10:38:29Z")

</div>

I’m additionally encountering this error on a mojave image (xcode 10.2.3)

```auto
==> Installing imagemagick dependency: python
==> Downloading https://homebrew.bintray.com/bottles/python-3.7.6_1.mojave.bottl
==> Downloading from https://akamai.bintray.com/64/643d627c2b4fc03a3286c397d2992
######################################################################## 100.0%
==> Pouring python-3.7.6_1.mojave.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink Frameworks/Python.framework/Headers
Target /usr/local/Frameworks/Python.framework/Headers is a symlink belonging to python@2. You can unlink it:
  brew unlink python@2

To force the link and overwrite all conflicting files:
  brew link --overwrite python

To list all files that would be deleted:
  brew link --overwrite --dry-run python

Possible conflicting files are:
/usr/local/Frameworks/Python.framework/Headers -> /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Headers
/usr/local/Frameworks/Python.framework/Python -> /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Python
/usr/local/Frameworks/Python.framework/Resources -> /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Resources
/usr/local/Frameworks/Python.framework/Versions/Current -> /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/Current
==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta
==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta
==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg insta
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python/libexec/bin

If you need Homebrew's Python 2.7 run
  brew install python@2

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python

```

after other dependencies are correctly installed, the process will end with the following line

```auto
Exited with code exit status 1
CircleCI received exit code 1

```

which kills the build.

---

<div class="post-metadata">

**Author:** ![twelve17](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/twelve17/32/22758_2.png) [@twelve17](https://discuss.circleci.com/u/twelve17)\
**Post date:** [January 3, 2020, 12:55pm UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/4 "2020-01-03T12:55:04Z")

</div>

This is a long shot, but could this have to do with python2 reaching EOL in 2020? There’s a long discussion in the homebrew discourse about this:

> **[Python 2 EOL 2020](https://discourse.brew.sh/t/python-2-eol-2020/4647/25)**
>
> More stuff is being removed or ported to Pyhton3: The PR for the deletion of Python 2 has been opened too:

---

<div class="post-metadata">

**Author:** ![Hatko](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/hatko/32/22868_2.png) [@Hatko](https://discuss.circleci.com/u/Hatko)\
**Post date:** [January 6, 2020, 1:37pm UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/5 "2020-01-06T13:37:49Z")

</div>

Any updates on it?

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [January 6, 2020, 8:33pm UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/6 "2020-01-06T20:33:39Z")

</div>

> [@Hatko](#):
>
> Any updates on it?

Are you looking for help on your own problem? If so, post the details - perhaps readers would need more information than what is in the original post.

---

<div class="post-metadata">

**Author:** ![Salomonsan](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/salomonsan/32/23938_2.png) [@Salomonsan](https://discuss.circleci.com/u/Salomonsan)\
**Post date:** [January 7, 2020, 1:22pm UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/7 "2020-01-07T13:22:15Z")

</div>

hello,

i’ve the same problem with the same output, how i get my deployment running ?

---

<div class="post-metadata">

**Author:** ![dimpiax](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dimpiax/32/23942_2.png) [@dimpiax](https://discuss.circleci.com/u/dimpiax)\
**Post date:** [January 7, 2020, 3:52pm UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/8 "2020-01-07T15:52:40Z")

</div>

I’ve received the answer from support, and it works.

> This appears to be a regression in the latest version of Homebrew itself as disabling the Homebrew updater appears to allow ImageMagick to install correctly.
> 
> Please try disabling the automatic updater by following the guide located here: [Disable Homebrew Automatic Updater](https://support.circleci.com/hc/en-us/articles/360037683553-Disable-Homebrew-Automatic-Updater?source=search&auth_token=eyJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjo4MjgyMDksInVzZXJfaWQiOjQwMDY1Njg5NTEzMywidGlja2V0X2lkIjo2NTMzNywiY2hhbm5lbF9pZCI6NjMsInR5cGUiOiJTRUFSQ0giLCJleHAiOjE1ODA5OTc3MjN9.ikqqtjbT5bKuE6qBnIQDSxFQpYGYfv3XZnhTu08BSLY)

---

<div class="post-metadata">

**Author:** ![ashishb](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ashishb/32/19751_2.png) [@ashishb](https://discuss.circleci.com/u/ashishb)\
**Post date:** [January 9, 2020, 8:37am UTC](https://discuss.circleci.com/t/brew-link-step-failing-on-python-dependency/33925/9 "2020-01-09T08:37:42Z")

</div>

Even Travis CI is failing for me - [https://travis-ci.org/ashishb/dotfiles](https://travis-ci.org/ashishb/dotfiles)  
So, this is not Circle CI specific - [https://travis-ci.org/ashishb/dotfiles/jobs/634627308](https://travis-ci.org/ashishb/dotfiles/jobs/634627308)
