Lately, I got this warning:
CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
Should I upgrade Gspread or Python ? Cause all code are in Python 2, it is hard to move to python 3.
I recently started to see this on macOS 10.15.7 (Catalina) when running Google Cloud tools written in Python (gcloud and gsutil). For example:
$ gsutil ls gs://<object store bucket and object path>
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
from cryptography import x509
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
from cryptography import x509
<expected output>
This solves it:
$ pip install cryptography==2.2.2
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.
Defaulting to user installation because normal site-packages is not writeable
Collecting cryptography==2.2.2
Using cached cryptography-2.2.2-cp27-cp27m-macosx_10_6_intel.whl (1.5 MB)
Requirement already satisfied: ipaddress; python_version < "3" in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from cryptography==2.2.2) (1.0.22)
...
Successfully installed cryptography-2.2.2
Note that it only installs it for the current user. It may or may not be safe to do this with sudo and update the system-wide copy. This was good enough for me, and lower risk.
pip install cryptography==2.2.2
Works fine with out warnings
Related
I try to install tensorflow==1.1.0 for Python2.7 with pip package manager but am getting the following error when I run the command pip install tensorflow:
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 pip.pypa.io/en/latest/development/release-process/… pip 21.0 will remove support for this functionality.
ERROR: Could not find a version that satisfies the requirement tensorflow==1.1.0 (from versions: none)
ERROR: No matching distribution found for tensorflow==1.1.0
How else can I install tensorflow for Python2.7?
Thank you!
You could use a ready to use Docker image.
https://hub.docker.com/r/tensorflow/tensorflow/tags?page=1&name=1.1.0
The tags with the postfix ”py3“ indicate using Python 3.x while the ones without this postfix are using Python 2.7.
Here some additional information about the Docker images. https://hub.docker.com/r/tensorflow/tensorflow/
Dockerfiles for TF 1.1.0 https://github.com/tensorflow/tensorflow/tree/v1.1.0/tensorflow/tools/docker
I was asked to fix an old installation of a Django App
I was going through the package dependencies and saw that during a server change they probably lost some python modules:
Installed is:
Python 2.7.5 and Django (1.8)
pip 8.1.2
edit: django-mptt 0.9.1
I need to install django-mptt-admin
but I get this error when doing pip install django-mptt-admin:
...
Collecting Django>=1.11 (from django-mptt->django-mptt-admin==0.5.8)
Using cached https://files.pythonhosted.org/packages/7e/ae/29c28f6afddae0e305326078f31372f03d7f2e6d6210c9963843196ce67e/Django-2.1.7.tar.gz
Complete output from command python setup.py egg_info:
==========================
Unsupported Python version
==========================
This version of Django requires Python 3.5, but you're trying to
install it on Python 2.7.
This may be because you are using a version of pip that doesn't
understand the python_requires classifier. Make sure you
have pip >= 9.0 and setuptools >= 24.2, then try again:
the question is now:
How can I find the right version of django-mptt-admin and save myself the problem of upragding all python, django and their dependencies?
Its a non documented app which probably has some more problems in it
In tried
pip install django-mptt-admin==0.2.1 (from 0.5.8 down to 0.2.1) but always with the same error.
I think you install django-mptt as dependency for django-mptt-admin. And there in dependencies is Django>=1.11. You must fix version of django-mptt-admin and django-mptt for both.
Why don't you check the release history?
https://pypi.org/project/django-mptt-admin/#history
I would like to check what version of twisted python is installed on my OS. I need to have a version 17.1.0 or greater and I work on CentOS 7.
I tried this:
(.synapse)[root#nexus-chat1 .synapse]# twisted -v
-bash: twisted : commande introuvable
But how can I upgrade my version? If I do this, will it update it?
(.synapse)[root#nexus-chat1 .synapse]# pip install twisted
Use:
pip search twisted
among the output you should see the desired information:
Twisted (17.9.0) - An asynchronous networking framework written in Python
INSTALLED: 16.3.0
LATEST: 17.9.0
update to latest available version with:
pip install --upgrade twisted
if you has installed twisted, you can write pip show twisted
(venv) ➜ testTwisted pip show twisted
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.
Name: Twisted
Version: 20.3.0
Summary: An asynchronous networking framework written in Python
Home-page: https://twistedmatrix.com/
Author: Twisted Matrix Laboratories
Author-email: twisted-python#twistedmatrix.com
License: MIT
Location: /home/ss/testTwisted/venv/lib/python2.7/site-packages
Requires: hyperlink, attrs, Automat, PyHamcrest, incremental, zope.interface, constantly
Required-by:
I want to accelerate downloading Python packages with PyPi mirrors(our company mirror), but the pip can't select correct iPython version from mirrors. I guess the problem maybe has relation with PyPi index database. If someone know anything about that problem, welcome to tell me.
Python version:
(p2) ➜ /tmp python --version
Python 2.7.13
Here is my ~/.pip/pip.conf
[global]
index-url = http://mirrors.company.com/pypi/simple/
trusted-host=mirrors.company.com
The following error message was print when I used pip install ipython
(p2) ➜ /tmp pip install ipython
Collecting ipython
Downloading http://mirrors.aliyun.com/pypi/packages/79/63/b671fc2bf0051739e87a7478a207bbeb45cfae3c328d38ccdd063d9e0074/ipython-6.1.0.tar.gz (5.1MB)
100% |████████████████████████████████| 5.1MB 7.6MB/s
Complete output from command python setup.py egg_info:
IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.
When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
Beginning with IPython 6.0, Python 3.3 and above is required.
See IPython `README.rst` file for more information:
https://github.com/ipython/ipython/blob/master/README.rst
Python sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0) detected.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6c/gbrkbbzd4gvdp56x7x8s6xpw0000gn/T/pip-build-FVITyR/ipython/
Your Proxy/Mirror does not implement pep503 correctly and your pip may be is out of date (you need pip 9.0.1+). Since December 2016 PyPI has been fixed to correctly expose extra metadata telling Pip with which Python version a package is compatible (My talk at PyCon , and PyBay this year about this).
To be sure, check this page on PyPI, you can see in the source the link of IPython 6.0.0:
<a data-requires-python=">=3.3" href="../../packages/.../ipython-6.0.0.tar.gz" >ipython-6.0.0.tar.gz</a><br/>
Now check the same page on your mirror... it is missing the data-requires-python=">=3.3" field, so pip cannot know IPython 6.0 is incompatible. I would suggest to contact the people running the mirror to update it.
Also please setup your mirror to only allow https, or you will be unsure that what you are downloading has not been tampered with !
When I try to install Pillow (as a wheel file)
C:\Python27\Scripts>pip install C:\Users\karth\Desktop\Pillow-3.4.2-cp36-cp36m-win_amd64.whl
I get the following error.
Pillow-3.4.2-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
You have a wheel file which is expecting a different Python version.
The cp36, indicates CPython 3.6, i.e. Python 3.6. You are running Python 2.7.
Either update your Python version, or more suitably, get a wheel file of the correct version from PyPi https://pypi.python.org/pypi/Pillow/4.0.0