解决Python出现_warn_unsafe_extraction问题的方法
程序员文章站
2022-04-10 16:12:38
...
在Python项目中运行出现了“AttributeError: ResourceManager instance has no attribute ‘_warn_unsafe_extraction'”问题,研究了一下,发现是setuptools在MacOS下的一个问题(见下图),我出现问题的是pymongo的库,需要删除pymongo,然后降级setuptools再重新安装。
解决方法:
1、删除pymongo:
sudo easy_install -mxN pmongo
2、降级setuptools:
sudo easy_install -mxN setuptools sudo easy_install "setuptools3、重装pymongo:
sudo easy_install pymongo问题解决!!!!!
附错误信息:
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/yourtion/Codes/python/knowme/server.py Traceback (most recent call last): File "/Users/yourtion/Codes/python/knowme/server.py", line 5, infrom Handler.api import UserHandler File "/Users/yourtion/Codes/python/knowme/Handler/api.py", line 3, in from Model.user import User File "/Users/yourtion/Codes/python/knowme/Model/user.py", line 2, in from mongoengine import * File "build/bdist.macosx-10.9-intel/egg/mongoengine/__init__.py", line 1, in File "build/bdist.macosx-10.9-intel/egg/mongoengine/document.py", line 4, in File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/pymongo/__init__.py", line 80, in File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/pymongo/connection.py", line 39, in 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 File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/bson/__init__.py", line 41, in File "/Library/Python/2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.8-intel.egg/bson/_cbson.py", line 7, in 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_path AttributeError: ResourceManager instance has no attribute '_warn_unsafe_extraction' Process finished with exit code 1 原文链接:http://blog.yourtion.com/solve-warn_unsafe_extraction.html
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
相关文章
相关视频
专题推荐
- 独孤九贱-php全栈开发教程
全栈 170W+
主讲:Peter-Zhu 轻松幽默、简短易学,非常适合PHP学习入门
- 玉女心经-web前端开发教程
入门 80W+
主讲:灭绝师太 由浅入深、明快简洁,非常适合前端学习入门
- 天龙八部-实战开发教程
实战 120W+
主讲:西门大官人 思路清晰、严谨规范,适合有一定web编程基础学习
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论