Installation fails on Mac OS X 10.9 (Mavericks)
Opened this issue · 9 comments
I tried installing with
ansible-vim-snippet-generator bfisher$ sudo ./setup.py install
Password:
running install
running bdist_egg
running egg_info
...
and it seemed happy at first, until it got to this step:
Installed /Library/Python/2.7/site-packages/ansible_snippet_gen-1.3.2-py2.7.egg
Processing dependencies for ansible-snippet-gen==1.3.2
Searching for ansible
Reading http://pypi.python.org/simple/ansible/
Best match: ansible 1.7.2
Downloading https://pypi.python.org/packages/source/a/ansible/ansible-1.7.2.tar.gz#md5=6c9112a2e7d7d1394c97e57290fc13be
Processing ansible-1.7.2.tar.gz
Running ansible-1.7.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-1Itp3T/ansible-1.7.2/egg-dist-tmp-Ry8fj8
warning: no files found matching 'packaging/distutils/setup.py'
error: Setup script exited with error: SandboxViolation: mkdir('/usr/share/ansible', 511) {}
The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.
If that is not enough information, I can post the entire output as a gist.
FWIW I installed ansible in /usr/local/bin using Homebrew and I still have the sources under /usr/local.
What seems to be the issue is that the setup script is being run using OS X's included python instead of Homebrew's. Perhaps using /usr/local/bin/python setup.py install will work?
I do not think so. In fact, Homebrew did not install python at all. There is no /usr/local/bin/python.
Besides, the error message seems to be saying that the problem comes when easy_install tries to install ansible, and is not allowed to. There must be a reason that the standard instructions for installing ansible are not .$ sudo easy_install ansible
The reason why I am certain it is using the system Python is because the setup tools library selects the site packages location based on which Python you use. The site packages location is set to your library site packages, where Ansible clearly didn't install.
The issue is what Homebrew does to patch Ansible to use a Homebrew local site package directory while still using the system Python.
Does /usr/local/share/ansible exist?
It seems that Homebrew monkey patches Ansible to use a different PYTHONPATH. The easy way to fix all this is to install Python with Homebrew, but if you are determined to make this work another way you can fiddle with your environment variables.
Yes, /usr/local/share/ansible exists.
I tried installing python with Homebrew. I did $ brew link --overwrite python to get it to link to /usr/local/bin. I ran the setup script successfully: /usr/local/bin/python setup.py install. Now I get this:
$ bin/ansible_snippet_gen
Traceback (most recent call last):
File "bin/ansible_snippet_gen", line 22, in <module>
from ansible_snippet_gen import __version__
ImportError: No module named ansible_snippet_gen
I am thinking of un-brewing all things python (including ansible) and starting over with $ sudo easy_install pip; sudo pip install ansible.
Now that you're working with standard Python, it is likely that I fragged the setup file in a matter where a development link and install differ from a regular install. I'll check it out later today.
Alright, can you give the last commit I made a try?