Jin*_*ude 8 pip installation python3 ansible debian-stretch
我已经通过安装了 Ansible pip3,但找不到 Ansible 命令(ansible --version、ansible-playbook等)
以下列表显示 Ansible 是通过以下方式安装的pip3:
:~# pip3 list | grep ansible
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
ansible (3.1.0)
ansible-base (2.10.7)
Run Code Online (Sandbox Code Playgroud)
但我找不到任何文件或任何内容,/usr/bin并且找不到命令:
:~/.ansible# ls -ltrha
total 12K
drwx------ 3 root root 4.0K Feb 3 11:42 .
drwx------ 3 root root 4.0K Mar 19 16:01 tmp
drwx------ 8 root root 4.0K Mar 22 15:34 ..
Run Code Online (Sandbox Code Playgroud)
我需要配置一些东西吗?我的安装是否不正确?
我使用 Debian GNU/Linux 9(延伸)
小智 1
这种情况往往会发生,正如 @micke 评论的那样 - 作为用户使用时pip3-root安装的 CLI 工具可能最终位于未包含在$PATH环境变量中的目录中 - 那么你需要进行调整$PATH。
在 Debian10 上测试,一切都符合预期:
\nroot@d10:~# pip3 install ansible\nCollecting ansible\n Downloading https://files.pythonhosted.org/packages/fd/f8/071905c6a67592d0852a9f340f6ab9226861eeeb97fdf4068642b22edcf3/ansible-4.10.0.tar.gz (36.8MB)\n 100% |\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88| 36.8MB 35kB/s \n#pip3 install log truncated...\n root@d10:~# ansible --version\n[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.3 (default, Jan 22 2021, \n20:04:44) [GCC 8.3.0]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting \ndeprecation_warnings=False in ansible.cfg.\nansible [core 2.11.7] \n config file = None\n configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\n ansible python module location = /usr/local/lib/python3.7/dist-packages/ansible\n ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections\n executable location = /usr/local/bin/ansible\n python version = 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]\n jinja version = 3.0.3\n libyaml = True\nroot@d10:~# which ansible\n/usr/local/bin/ansible\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
27565 次 |
| 最近记录: |