Why can't I find one available when I install it using setup.py?

Since I had some problems with Ansible (I'm on a Mac) that seems to have been fixed in the latest version for developers today, I uninstalled ansible via pip ( sudo pip uninstall ansible) and reinstalled the latest version of dev from the github repository using the classic install..py method which seemed to succeed ( full conclusion here .

So, I tried using it:

$ ansible --version
-bash: ansible: command not found
$ which ansible
$

I checked where it is installed. From the full output that I referenced above, I found that it is installed in /usr/local/lib/python2.7/site-packages, and indeed there I find the egg:

$ ls -l /usr/local/lib/python2.7/site-packages | grep ansible
drwxr-xr-x    4 root    admin     136 Aug 22 16:33 ansible-2.4.0-py2.7.egg

When I run Python and check the site-packages folder, I find another folder:

>>> import site; print site.getsitepackages()[0]
/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

but this is a symbolic link to the same folder:

$ ls -l /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
lrwxr-xr-x  1 hielke  admin  54 Aug 13 22:36 /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages -> ../../../../../../../../../lib/python2.7/site-packages

, , , ansible /usr/local/bin/. , -.

- , ? !

+6
3

ansible , bash $PATH ansible, . , , . .egg , , .

ansible , , locate OSX Finder. , . , ansible-connection, ansible-console .. , ansible. , ! $PATH :

export PATH=$PATH:/path/to/ansible

/path/to/ansible - , . $PATH , ​​ . bash, , $HOME/.bash_profile /etc/paths.d ( Apple). , , .

, ansible, - . ( ), , , github, :

git clone https://github.com/ansible/ansible.git
cd ansible
virtualenv venv
source venv/bin/activate
pip install .
which ansible

ansible.

+3

Ansible pip , Ansible:

, :

pip install git+https://github.com/ansible/ansible.git@devel

OS X Mavericks, . :

$ sudo CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install ansible

, virtualenv, Ansible virtualenv, wed Ansible . easy_install .

0

, ANSIBLE Mac. /Users/<yourusername>/Library/Python/3.7/bin /Users/<yourusername>/Library/Python/2.7/bin. ...

export PATH=$PATH:/Users/<yourusername>/Library/Python/3.7/bin

.bashrc.

0

Source: https://habr.com/ru/post/1684234/


All Articles