I am running a Linux server (Linux 4.1.12-124.19.1.el7uek.x86_64 #2 SMP Wed Sep 5 13:41:16 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux) with python 2.7.5 on it (DBAs want it to be 2.7.5 for their script) and trying to get pip and requests running.
I was having a problem getting pip on, because when I would try to install the epel-release
, it would tell me “no package” named that. So I had to do
"yum install http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
Which finally let me do
"yum install python-pip"
to get pip installed.
I then did
"python -m pip install requests"
to install requests.
It looked good, but when I run the test script that the DBAs gave me to check, it gives me this.
"Traceback (most recent call last):
File "/mnt/EBS_Cloning_Repo/clone/scripts/test.py", line 2, in <module>
import requests
File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 133, in <module>
from . import utils
File "/usr/lib/python2.7/site-packages/requests/utils.py", line 27, in <module>
from . import certs
File "/usr/lib/python2.7/site-packages/requests/certs.py", line 15, in <module>
from certifi import where
File "/usr/lib/python2.7/site-packages/certifi/__init__.py", line 1, in <module>
from .core import contents, where
File "/usr/lib/python2.7/site-packages/certifi/core.py", line 17
def where() -> str:
^
SyntaxError: invalid syntax"
I did find that this could be caused by running just the python command, instead of one like python2, so I try redoing some of the commands with the python2 command with the same results.
I do have another server, running as it should with this, and I compared the files that it is pointing to, and seeing some missing information in them (diff output one request), but I am not sure what I can do with that information.