Reputation: 1
My ansible broke so i un-installed it , it was also givning error for setup tool
i also uninstall pyhthon3.x
It is a centos 7.8 server
even yum install ansible does not work now ( i have epel )
Please suggest
pip install ansible
/usr/lib/python2.7/site-packages/pkg_resources/py2_warn.py:21: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please follow up at
..
************************************************************
sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
Traceback (most recent call last):
File "/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python2.7/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 24, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.py", line 16, in <module>
from pip._internal.index.package_finder import PackageFinder
File "/usr/lib/python2.7/site-packages/pip/_internal/index/package_finder.py", line 21, in <module>
from pip._internal.index.collector import parse_links
File "/usr/lib/python2.7/site-packages/pip/_internal/index/collector.py", line 14, in <module>
from pip._vendor import html5lib, requests
File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py", line 97, in <module>
from pip._vendor.urllib3.contrib import pyopenssl
File "/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/usr/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python2.7/site-packages/OpenSSL/crypto.py", line 15, in <module>
from OpenSSL._util import (
File "/usr/lib/python2.7/site-packages/OpenSSL/_util.py", line 152, in <module>
with ffi.from_buffer(b""):
TypeError: from_buffer() cannot return the address of the raw string within a str or unicode or bytearray object
Upvotes: 0
Views: 861
Reputation: 44595
Note: I cannot reproduce your exact problem (tested with several options on a centos:7 docker container with python2). Meanwhile, below, a procedure to install in python3 that I use and I know is working.
Python 2 is dead. Although it still sits arround on a centos:7 installation, you should definitely install ansible with python 3.
First make sure you have python3 and pip3:
yum install -y python3-pip
In case you still have pip2 installed (which seems to be the case), make sure the pip
command defaults to the python3 version
pip3 install --upgrade --force-reinstall pip
Now you can install ansible without any obsolescence warnings and a version of python that will be supported
pip install ansible
Upvotes: 3