# Average\_response python2 Error

**URL:** <https://community.mrtrix.org/t/average-response-python2-error/553>\
**Category:** Uncategorized\
**Created:** [November 3, 2016, 7:54pm UTC](https://community.mrtrix.org/t/average-response-python2-error/553 "2016-11-03T19:54:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbishop](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/j/f05b48/32.png) [@jbishop](https://community.mrtrix.org/u/jbishop)\
**Post date:** [November 3, 2016, 7:54pm UTC](https://community.mrtrix.org/t/average-response-python2-error/553/1 "2016-11-03T19:54:57Z")

</div>

Dear Experts,

Has anyone had this issue while trying to use average\_response ? I have tried to create a symbolic link without any luck. I downloaded python using brew install and I have the executable python2 file, however, it’s in /usr/local/bin/python2 and not /usr/bin/python2. It seems challenging, even as a super user or root to try to move this file into /usr/bin/.

Thanks,

James

![](https://community.mrtrix.org/uploads/default/original/1X/ae61d8213d015a1d25cffcbf5e0f04aafba0b3cf.png)

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [November 3, 2016, 9:20pm UTC](https://community.mrtrix.org/t/average-response-python2-error/553/2 "2016-11-03T21:20:29Z")

</div>

Haven’t come across that one before, but it sounds like [this issue](http://unix.stackexchange.com/questions/126540/how-do-i-get-realpath-to-find-my-symbolic-link). It seems the symbolic link is not needed, what you need is to make sure that whatever folder contains the actual `python` executable is in your path. From what you state, this should do it for your setup:

```
export PATH=/usr/local/bin:$PATH

```

And try again. If that works, you’ll want to add that line to the appropriate shell startup file, presumably `~/.bash_profile` on a MacOSX system.

However, I’m surprised this folder isn’t already in your PATH, as far as I understand, that’s the default location for homebrew commands. @maxpietsch, can you figure out what might be going on?

---

<div class="post-metadata">

**Author:** ![Dave](https://community.mrtrix.org/user_avatar/community.mrtrix.org/dave/32/7_2.png) [@Dave](https://community.mrtrix.org/u/Dave)\
**Post date:** [November 3, 2016, 9:49pm UTC](https://community.mrtrix.org/t/average-response-python2-error/553/3 "2016-11-03T21:49:34Z")

</div>

I’ve just pushed a fix so that average response relies on: `#!/usr/bin/env python`

And made the code python 2 and 3 compatible.

@jbishop, feel free to update and try this in half an hour or so once the tests have passed.

---

<div class="post-metadata">

**Author:** ![maxpietsch](https://community.mrtrix.org/user_avatar/community.mrtrix.org/maxpietsch/32/25_2.png) [@maxpietsch](https://community.mrtrix.org/u/maxpietsch)\
**Post date:** [November 3, 2016, 9:57pm UTC](https://community.mrtrix.org/t/average-response-python2-error/553/4 "2016-11-03T21:57:53Z")

</div>

> [@jbishop](#):
>
> It seems challenging, even as a super user or root to try to move this file into /usr/bin/.

Careful, you do not want to do that as it might break your system.

> [@jbishop](#):
>
> /usr/bin/python2

AFAIK does not exist on OSX by default, /usr/bin/python2.7 does on my system but I [think](http://nedbatchelder.com/blog/201312/versioned_python_commands_on_mac.html) OSX should use that anyway.

average\_response works for me and `which python2` points to my virtual environment location in my home directory so not sure either…

---

<div class="post-metadata">

**Author:** ![jbishop](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/j/f05b48/32.png) [@jbishop](https://community.mrtrix.org/u/jbishop)\
**Post date:** [November 4, 2016, 6:46pm UTC](https://community.mrtrix.org/t/average-response-python2-error/553/5 "2016-11-04T18:46:56Z")

</div>

Thank you all very much for the help, especially for editing the code. I upgraded the version and the command seems to be working now. Problem solved!

James
