(Jul-19-2020, 08:51 AM)snippsat Wrote: When you do yum install pexpect
it will install to Python 2.
When you type python3
it start Python 3.6.8.
So should use pip
to install pexpect.
python3 -m pip install --user pexpect
Also try pip3 -V
command this should point to Python 3.6.
May need to install it.
python3.6 -m ensurepip
# Or a repository that has it
yum install --assumeyes python3-pip
Now test with pip3 -V
and it should point to 3.6.
Example.
pip3 -V
pip 18.0 from /usr/local/lib/python3.6/site-packages/pip-18.0-py3.6.egg/pip (python 3.6)
Then install to 3.6 would be.
pip3 install --user pexpect
The server isn't connected to Internet, I mounted RHEL 7.8 DVD and using it as a repository. Received the following errors:
[root@IBBFDPLSPW010 ~]# python3 -m pip install --user pexpect
WARNING: Running pip install with root privileges is generally not a good idea. Try
__main__.py install --user
instead.
Collecting pexpect
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fceb21ab9e8>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fceb21ab0b8>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fceb21ab400>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fceb21abc18>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fceb21aba90>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Could not find a version that satisfies the requirement pexpect (from versions: )
No matching distribution found for pexpect
[root@IBBFDPLSPW010 ~]# echo $?
1
[root@IBBFDPLSPW010 ~]# python3.6 -m ensurepip
WARNING: Running pip install with root privileges is generally not a good idea. Try
__main__.py install --user
instead.
Requirement already satisfied: setuptools in /usr/lib/python3.6/site-packages
Requirement already satisfied: pip in /usr/lib/python3.6/site-packages
[root@IBBFDPLSPW010 ~]# yum install --assumeyes python3-pip
Loaded plugins: product-id, search-
: disabled-repos,
: subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
rhel-dvd | 2.8 kB 00:00
Package python3-pip-9.0.3-5.el7.noarch already installed and latest version
Nothing to do
[root@IBBFDPLSPW010 ~]#
[root@IBBFDPLSPW010 ~]# pip3 -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
[root@IBBFDPLSPW010 ~]# pip3 install --user pexpect
WARNING: Running pip install with root privileges is generally not a good idea. Try
pip3 install --user
instead.
Collecting pexpect
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fefb1455d68>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fefb1455320>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fefb1455668>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fefb14552b0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fefb14554e0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pexpect/
Could not find a version that satisfies the requirement pexpect (from versions: )
No matching distribution found for pexpect
[root@IBBFDPLSPW010 ~]#