Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

install ansible error because of stale pyyaml #48

Closed
supernan1994 opened this issue Feb 17, 2019 · 3 comments
Closed

install ansible error because of stale pyyaml #48

supernan1994 opened this issue Feb 17, 2019 · 3 comments

Comments

@supernan1994
Copy link

supernan1994 commented Feb 17, 2019

Bug Report

What I have done:

$ tar -xzvf dm-ansible-latest.tar.gz
$ mv dm-ansible-latest dm-ansible
$ cd /home/tidb/dm-ansible
$ sudo pip install -r ./requirements.txt
$ ansible --version

What I expect to see:

ansible 2.5.0

What I actually see:

Traceback (most recent call last):
  File "/bin/ansible", line 67, in <module>
    import ansible.constants as C
  File "/usr/lib/python2.7/site-packages/ansible/constants.py", line 17, in <module>
    from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value
  File "/usr/lib/python2.7/site-packages/ansible/config/manager.py", line 16, in <module>
    from yaml import load as yaml_load
ImportError: No module named yaml

Fixed by:

$ sudo pip install pyyaml --ignore-installed
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting pyyaml
  Downloading http://mirrors.aliyun.com/pypi/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz (270kB)
    100% |████████████████████████████████| 276kB 3.4MB/s
Installing collected packages: pyyaml
  Running setup.py install for pyyaml ... done
Successfully installed pyyaml-3.13

Maybe we should make sure pyyaml is up to date.

@supernan1994 supernan1994 changed the title Install ansible error because of stale pyyaml install ansible error because of stale pyyaml Feb 17, 2019
@amyangfei
Copy link
Contributor

This is a little strange, as PyYAML is in ansible install dependencies.
We can find Collecting PyYAML (from ansible<2.7.0,>=2.5.0->-r requirements.txt (line 1)) when installing ansible via pip.
Did you install ansible from a clean python env, or whether there are some errors when you run sudo pip install -r ./requirements.txt?

@csuzhangxc
Copy link
Member

@supernan1994

Did you install ansible from a clean python env, or whether there are some errors when you run sudo pip install -r ./requirements.txt?

any feedback?

@csuzhangxc
Copy link
Member

@supernan1994 I'll close it now and if you have any problem you can re-open it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants