时间:2021-05-22
在Python项目中运行出现了“AttributeError: ResourceManager instance has no attribute ‘_warn_unsafe_extraction'”问题,研究了一下,发现是setuptools在MacOS下的一个问题(见下图),我出现问题的是pymongo的库,需要删除pymongo,然后降级setuptools再重新安装。
解决方法:
1、删除pymongo:
sudo easy_install -mxN pmongo2、降级setuptools:
sudo easy_install -mxN setuptoolssudo easy_install "setuptools<0.7"3、重装pymongo:
sudo easy_install pymongo问题解决!!!!!
附错误信息:
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/yourtion/Codes/python/knowme/server.pyTraceback (most recent call last): File "/Users/yourtion/Codes/python/knowme/server.py", line 5, in <module> from Handler.api import UserHandler File "/Users/yourtion/Codes/python/knowme/Handler/api.py", line 3, in <module> from Model.user import User File "/Users/yourtion/Codes/python/knowme/Model/user.py", line 2, in <module> from mongoengine import * File "build/bdist.macosx-10.9-intel/egg/mongoengine/__init__.py", line 1, in <module> File "build/bdist.macosx-10.9-intel/egg/mongoengine/document.py", line 4, in <module> File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/pymongo/__init__.py", line 80, in <module> File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/pymongo/connection.py", line 39, in <module> File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/pymongo/mongo_client.py", line 44, in <module> File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/bson/__init__.py", line 41, in <module> File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/bson/_cbson.py", line 7, in <module> File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/bson/_cbson.py", line 4, in __bootstrap__ File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 914, in resource_filename %s File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 1601, in get_resource_filename """Retrieve a PEP 302 "importer" for the given path item File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 1629, in _extract_resource from pkgutil import get_importer, ImpImporter File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 990, in get_cache_pathAttributeError: ResourceManager instance has no attribute '_warn_unsafe_extraction'Process finished with exit code 1原文链接:http://blog.yourtion.com/solve-warn_unsafe_extraction.html
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
问题你希望自己的程序能生成警告信息(比如废弃特性或使用问题)。解决方案要输出一个警告消息,可使用warning.warn()函数。例如:importwarnin
本文实例讲述了python抓取并保存html页面时乱码问题的解决方法。分享给大家供大家参考,具体如下:在用Python抓取html页面并保存的时候,经常出现抓取
python使用super()出现错误解决办法当我们在python的子类中调用父类的方法时,会用到super(),不过我遇到了一个问题,顺便记录一下。比如,我写
本文实例讲述了Python中MYSQLdb出现乱码的解决方法,分享给大家供大家参考。具体方法如下:一般来说,在使用mysql最麻烦的问题在于乱码。查看mysql
如题,解决Python中用PyQt时中文乱码问题的解决方法:在中文字符串前面加上u,如u'你好,世界',其他网上的方法没有多去探究,Python的版本也会影响解