Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip module install of pycrypto deletes brewed Ansible's pycrypto, and other weirdness #10863

Closed
edrozenberg opened this issue Apr 29, 2015 · 4 comments
Labels
packaging Packaging category

Comments

@edrozenberg
Copy link
Contributor

Ansible 1.9.0.1

Target:

# Mac hosts
[hosts_mac]
localhost ansible_connection=local

Using the Ansible pip module to install pycrypto leads to deletion of Homebrewed Ansible's pycrypto.

Uninstall any pycrypto, then fresh-install ansible:

pip uninstall pycrypto
brew uninstall ansible && brew install ansible

Brewed Ansible's embedded pycrypto is present:

$ ls /usr/local/Cellar/ansible/1.9.0.1/libexec/vendor/lib/python2.7/site-packages/ | grep pycrypto
pycrypto-2.6-py2.7.egg-info

Now set up and run the playbook:

# Install pycrypto
- name: install pycrypto
  pip: name=pycrypto executable=pip2 state=latest

Brewed Ansible's embedded pycrypto is gone!:

$ ls /usr/local/Cellar/ansible/1.9.0.1/libexec/vendor/lib/python2.7/site-packages/ | grep pycrypto
<blank>

And since there's no more pycrypto, Ansible now won't run:

ERROR: ansible-vault requires a newer version of pycrypto than the one installed on your platform. You may fix this with OS-specific commands such as: yum install python-devel; rpm -e --nodeps python-crypto; pip install pycrypto

Other weirdness - pyasn1 claimed installed but isn't:

# Install pycrypto
- name: install pyasn1
  pip: name=pyasn1 executable=pip2 state=latest
TASK: [desktop/mac | install pyasn1] ****************************************** 
ok: [localhost]
$ pip list |grep pyasn1
$ <nothing>

Manually works fine after that though:

$ pip install pyasn1
Collecting pyasn1
  Using cached pyasn1-0.1.7.tar.gz
Installing collected packages: pyasn1
  Running setup.py install for pyasn1
Successfully installed pyasn1-0.1.7

More weirdness: using state=latest, the pip module did not upgrade I believe it was paramiko. It claimed it did but then I manually ran

pip install --upgrade paramiko

and that performed an upgrade.

Don't know if this is all one issue or several but having a very wonky experience with the pip module. Don't know where to start guessing where the issue is, wish I did...

@edrozenberg
Copy link
Contributor Author

I have an idea where to start guessing now :).

If I delete the pyasn1 from:

/usr/local/Cellar/ansible/1.9.0.1/libexec/vendor/lib/python2.7/site-packages/

And then run the Ansible playbook to install pyasn1, it then installs pyasn1 to

/usr/local/lib/python2.7/site-packages/

So the Ansible pip module is getting confused by looking at both of these site-packages dirs. It should only be looking at and modifying "/usr/local/lib/python2.7/site-packages/". Maybe Ansible needs to remove the other dir from the env when running the pip executable so pip doesn't get confused? Or is this a homebrew problem with the way homebrew installs the various dependencies into Ansible's own site-packages?

@sivel
Copy link
Member

sivel commented Apr 29, 2015

It is not recommended to install ansible via homebrew due to weird things homebrew does. The recommended way to install ansible on a Mac is directly via pip as explained at http://docs.ansible.com/intro_installation.html#latest-releases-on-mac-osx

@edrozenberg
Copy link
Contributor Author

Thanks, I'd seen that in the docs before but thought they'd just forgotten to mention HomeBrew. HomeBrew is the Mac People's Choice :). Will use pip now for Ansible.

@edrozenberg
Copy link
Contributor Author

There's an open Homebrew issue that seems to be referencing the problems I observed. I'll add some comments there - Homebrew/legacy-homebrew#35647

@dagwieers dagwieers added the packaging Packaging category label Mar 3, 2019
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
packaging Packaging category
Projects
None yet
Development

No branches or pull requests

3 participants