I cant install PIP on python 2.7 - python-2.7

SO when i try to install pip i get this error message any help
i am using python 2.7 because the course uses dependencies from python 2 so ya i cant use python 3 any help is greatly appreciated
python get-pip.py
this is the command i typed
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
f:\temp\temp\tmpbwi9va\pip.zip\pip\_vendor\urllib3\util\ssl_.py:424: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
f:\temp\temp\tmpbwi9va\pip.zip\pip_vendor\urllib3\util\ssl_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
ERROR: Could not find a version that satisfies the requirement pip<21.0 (from versions: none)
ERROR: No matching distribution found for pip<21.0

Related

Yum is not working in my Amazon Linux 1 instance [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 days ago.
Improve this question
This is in an EC2 instance with Amazon Linux 1
I'm trying to uninstall php-5.6 due to security concerns, but when I run: yum remove php-5.6 I obtaine:
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/usr/lib64/python2.7/dist-packages/pycurl.so: undefined symbol: CRYPTO_num_locks
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7.18 (default, Feb 18 2021, 06:10:44)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
I remember that some time ago I had to update curl libraries using a package that was not included in the repos. Maybe that's related to this issue.
The thing is that I donĀ“t know how to deal with this issue. How could I fix yum or uninstall php-5.6 manually at least.... It would be nice to know if I have installed packages that depend on php-5.6, but that's another yum command that does not work.
I tried to install pycurl using pip, but that does not work:
# pip install pycurl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Requirement already satisfied: pycurl in /usr/lib64/python2.7/dist-packages (7.19.0)
# pip uninstall pycurl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Found existing installation: pycurl 7.19.0
ERROR: Cannot uninstall 'pycurl'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
I think I could try to install a RPM package, but I'm not sure about what version should I use.

How to install h5py for version 1.10

I am using tensorflow in a python module, which is called by a c++ file. I moved to a new computer, where I installed ros again. So it works on one computer, but not on the other. There I got the following error:
UserWarning: h5py is running against HDF5 1.10.0 when it was built against 1.10.4, this may cause problems '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple)
then I did:
pip2.7 uninstall h5py
pip2.7 install h5py==1.10.4
but then I get the following error:
No handlers could be found for logger "keyring.backend"
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement h5py==1.10.4 (from versions: 2.2.1, 2.3.0b1, 2.3.0, 2.3.1, 2.4.0b1, 2.4.0, 2.5.0, 2.6.0, 2.7.0rc2, 2.7.0, 2.7.1, 2.8.0rc1, 2.8.0, 2.9.0rc1, 2.9.0, 2.10.0)
ERROR: No matching distribution found for h5py==1.10.4
It seems like there is no 1.10.4 version. What should I do?
I have to use python2.7. Also if I just let the python2.7 script run, it works. Only in conjunction with ros I get this error. But I think I take the python version from the same folder.
Thank you

Is it still possible to use pipenv with Python 2.7?

I have Python2.7 & Python3.8 installed on my computer with pipenv. I managed to create a 2.7 project by running the following command:
pipenv --two install
pipenv shell
> python --version
> > Python 2.7.15
But when I tried to install a new dependancy using pipenv I got an TLS error due to SNIMissingWarning:
pip install pylint
...
[pipenv.exceptions.InstallError]: ['Collecting astroid==1.6.6 (from -r C:\\Users\\aymeric\\AppData\\Local\\Temp\\pipenv-pktqf1dv-requirements\\pipenv-66rq3_4k-requirement.txt (line 1))', " Could not fetch URL https://pypi.org/simple/astroid/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/astroid/ (Caused by SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping"]
[pipenv.exceptions.InstallError]: ["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.
More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support", 'c:\\users\\aymeric\\.virtualenvs\\firmware-pjqfwcnq\\lib\\site-packages\\ pip\\_vendor\\urllib3\\util\\ssl_.py:365: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform.
This may cause the server to present an incorrect TLS certificate, which can cause validation failures.
You can upgrade to a newer version of Python to solve this.
For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings', ' SNIMissingWarning', 'c:\\users\\aymeric\\.virtualenvs\\firmware-pjqfwcnq\\lib\\site-packages\\pip\\_vendor\\urllib3\\util\\ssl_.py:149: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
Which is odd because SNIMissingWarning should have been patch in 2.7.9 as explained in this link
If remote repositories are now unreachable from 2.7 virtualenv how can you do?
Kinds regards

Setting up a python environment on AWS using buildspec.yml

I have a local device farm that is running python 2.7.13 via Appium 1.6.5 on some android emulators. We want to increase our exposure and make use of the AWS device farm. The problem is that AWS only support Python 2.7.6 and they don't have plans to upgrade.
We need at least Python 2.7.9+ because any python below that doesn't support SSL with the "request" package.
We tried "request[security] == 2.9.1" but it introduces a dependency in the wheel packages that AWS doesn't support.
With python 2.7.6 on Windows and AWS we get the following errors when downloading packages with pip...
...
Collecting cryptography>=2.2.1 (from
pyOpenSSL>=0.13->requests[security]==2.9.1->-r
/tmp/scratchzAHCQI.scratch/test-packagep3mb8i/requirements.txt (line
5))
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning Downloading
https://files.pythonhosted.org/packages/22/21/233e38f74188db94e8451ef6385754a98f3cad9b59bedf3a8e8b14988be4/cryptography-2.3.1.tar.gz
(449kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "/tmp/pip-build-nqoNP_/cryptography/setup.py", line 28, in
"cryptography requires setuptools 18.5 or newer, please upgrade to a "
RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools
---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-build-nqoNP_/cryptography
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning You are using pip version 7.1.2, however
version 18.0 is available. You should consider upgrading via the 'pip
install --upgrade pip' command.
An AWS support engineer mentioned that we can setup our own environment to support a new version of Python. However, the documentation is very confusing as it doesn't specify what the "Tech Spec" file should be called (I assume buildspec.yml), where I should put it, whether we should still use wheel or just pip?
Can I use apt or should I use yum?
I've looked around the internet but can't really find anything related to python and the AWS tech spec. All I want to do is install Python 2.7.9, install the requirements and trigger the tests and be able to make post to https REST services.
Have anyone had to solve this issue before?
You can choose just from default 2.7.6 vs optional 3.4.3. Follow this post to setup python 3 environment: https://forums.aws.amazon.com/message.jspa?messageID=865585#868262

Python latest release 2.7 shows SSL error

I have downloaded & installed python latest 2.7 version (on date - 16th July). Initially i was unable to install even pip using cmd - python get-pip.py, somehow i managed to installed pip. Then i was unable to install any package using pip. It throws SSL error. Tried multiple ways to install but no go. No proxy or admin issues observed (admin confirmed the same).
Then i uninstalled & reinstalled 2.7.10 which resolved the issue. Please check the issue and resolve it.
This issue is mainly because of old unstable version, used 2.7.10 and then everything worked.