I'm following the Scrapy installation guide to install a fresh copy of python (2.7.11) despite I already have 2.6, 2.7.10 and 3.4.0. The installation was going fine until the final step with these errors
==> Pouring python-2.7.11.el_capitan.bottle.2.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
rm '/usr/local/bin/2to3'
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/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.4/bin/2to3
Error: Permission denied - /usr/local/Frameworks
Moreover
ls -l /usr/local/Frameworks
ls: /usr/local/Frameworks: No such file or directory
and
ls -l /usr/local/bin/2to3
lrwxr-xr-x 1 root wheel 66 7 Apr 2014 /usr/local/bin/2to3 -> ../../../Library/Frameworks/Python.framework/Versions/3.4/bin/2to3
My Questions:
1) should I have done sudo brew install python
instead of brew install python
? Hopefully I don't need to uninstall 2.7.11 & start over.
2) If I do the two steps they suggest rm '/usr/local/bin/2to3'
and brew link --overwrite python
, would I still be able to run python 3.4.0 for non-Scrapy purposes? Presumably I should do these with sudo
?
3) If I did #2, would the permission problem on /usr/local/Frameworks
resolve itself or do I need to do something else?
Follow up:
The suggestion to set up virtualenv is probably a good one. But I'd imagine I probably need to get the install completed first.
I have now removed 2to3. I also tried to run brew link --overwrite python
with sudo but it came back with this cowardly refusing to sudo brew link msg so I just went ahead and did it without sudo.
But brew link still failed on permissions
brew link --overwrite python
Linking /usr/local/Cellar/python/2.7.11... Error: Permission denied - /usr/local/Frameworks
However
ls -l /usr/local/Frameworks
ls: /usr/local/Frameworks: No such file or directory
Moreover, a lot of python related links in /usr/local/bin to the existing 3.4.0 (those links owned by root) and the new 2.7.11 (owned by me).
So what do I do now? Thanks a lot.