You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ansible 5.0.1虚拟环境运行时异常:'_AnsiblePathHookFinder'无'find_spec'属性问题求助

Ansible 5.0.1虚拟环境运行时异常:'_AnsiblePathHookFinder'无'find_spec'属性问题求助

大家好,我最近在为一个项目搭建虚拟环境,需要安装以下指定版本的依赖包:

ionoscloud==6.1.4
pytest==6.2.5
pytest-cov==3.0.0
ansible==5.0.1
PyYAML==6.0
kubernetes==24.2.0
pyOpenSSL==22.0.0
requests==2.28.1
urllib3==1.26.1
netaddr==0.8.0

我按照下面的步骤来创建和配置虚拟环境:

$ mkdir venv
$ cd venv
$ python -m venv .
$ cp /path/to/requirements.txt .
$ source bin/activate
$ pip install -r requirements.txt

等所有包安装完成后,我尝试运行ansible --version(或者其他任何ansible相关命令),结果遇到了如下异常:

ERROR! Unexpected Exception, this is probably a bug: '_AnsiblePathHookFinder' object has no attribute 'find_spec'
the full traceback was:

Traceback (most recent call last):
  File "/home/arbeit/code/virtual-environments/venv/bin/ansible", line 97, in <module>
    mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
                    ^^^^^^^

有没有朋友遇到过类似的问题呀?能不能帮我看看该怎么解决这个报错呢?

备注:内容来源于stack exchange,提问作者Turtle10000

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 12:53:18