/usr/lib64/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no...

本文介绍了解决Ansible在Python2.7环境下出现警告的方法。通过卸载原有Ansible并使用pip(Python2.7)重新安装,可以避免因Python版本不一致导致的问题。

 

 

 

升级python2.6到2.7后,执行ansible后一直显示警告,如标题所示。

因为安装ansible,使用的是yum的方式,而yum使用的是python2.6,所以ansible安装环境为python2.7

解决方式:

卸载安装的ansible,使用pip(python2.7)重新安装ansible即可

转载于:https://www.cnblogs.com/z-books/p/7131816.html

运行py文件报错:/usr/bin/python3 /Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 64866 --file /Users/shenxin/Desktop/176All/project/jiaoben/scriptproject/great/takealot_review250609amz/takealot_review_20250609amz.py AmazonCategories_20241018.csv _tal AmazonCategories_20241018_1.csv > outputamz.log 2>&1 & Connected to pydev debugger (build 223.8836.43) /Users/shenxin/Desktop/176All/project/jiaoben/scriptproject/great/takealot_review250609amz/takealot_review_20250609amz.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp /Library/Python/3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn( Traceback (most recent call last): File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/Library/Python/3.9/site-packages/emoji/__init__.py", line 1, in <module> from .models import Emoji as emoji_class File "/Library/Python/3.9/site-packages/emoji/models.py", line 14, in <module> from . import settings File "/Library/Python/3.9/site-packages/emoji/settings.py", line 5, in <module> EMOJI_IMG_TAG = getattr(settings, 'EMOJI_IMG_TAG', ( File "/Users/shenxin/Library/Python/3.9/lib/python/site-packages/django/conf/__init__.py", line 79, in __getattr__ self._setup(name) File "/Users/shenxin/Library/Python/3.9/lib/python/site-packages/django/conf/__init__.py", line 60, in _setup raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Requested setting EMOJI_IMG_TAG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. python-BaseException Traceback (most recent call last): File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_xml.py", line 161, in _get_type def _get_type(self, o, type_object, type_name): File "/Users/shenxin/Library/Python/3.9/lib/python/site-packages/django/utils/functional.py", line 254, in inner def inner(self, *args): File "/Users/shenxin/Library/Python/3.9/lib/python/site-packages/django/conf/__init__.py", line 51, in _setup def _setup(self, name=None): django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. Process finished with exit code 1
最新发布
06-11
[root@iZ2zeby6nf36xxrqneb3t3Z CVE-2021-44228]# pip uninstall charset-normalizer -y /usr/lib/python2.7/site-packages/OpenSSL/crypto.py:14: 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 utils, x509 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. WARNING: Skipping charset-normalizer as it is not installed. [root@iZ2zeby6nf36xxrqneb3t3Z CVE-2021-44228]# pip install charset-normalizer==2.0.12 /usr/lib/python2.7/site-packages/OpenSSL/crypto.py:14: 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 utils, x509 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. Looking in indexes: https://mirrors.aliyun.com/pypi/simple Collecting charset-normalizer==2.0.12 ERROR: Could not find a version that satisfies the requirement charset-normalizer==2.0.12 (from versions: 3.0.0rc1, 3.0.0, 3.0.1) ERROR: No matching distribution found for charset-normalizer==2.0.12 WARNING: You are using pip version 19.1.1, however version 20.3.4 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
03-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值