解决Python出现_warn_unsafe_extraction问题的方法


Posted in Python onMarch 24, 2016

在Python项目中运行出现了“AttributeError: ResourceManager instance has no attribute ‘_warn_unsafe_extraction'”问题,研究了一下,发现是setuptools在MacOS下的一个问题(见下图),我出现问题的是pymongo的库,需要删除pymongo,然后降级setuptools再重新安装。

解决Python出现_warn_unsafe_extraction问题的方法

解决方法:

1、删除pymongo:

sudo easy_install -mxN pmongo

2、降级setuptools:

sudo easy_install -mxN setuptools
sudo 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.py
Traceback (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_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

Python 相关文章推荐
使用python BeautifulSoup库抓取58手机维修信息
Nov 21 Python
python基础教程之lambda表达式使用方法
Feb 12 Python
简单的通用表达式求10乘阶示例
Mar 03 Python
CentOS中使用virtualenv搭建python3环境
Jun 08 Python
Python基于动态规划算法计算单词距离
Jul 25 Python
Python绘制3d螺旋曲线图实例代码
Dec 20 Python
详解Python 装饰器执行顺序迷思
Aug 08 Python
Python实现字符型图片验证码识别完整过程详解
May 10 Python
python中append实例用法总结
Jul 30 Python
Python3基本输入与输出操作实例分析
Feb 14 Python
Pandas —— resample()重采样和asfreq()频度转换方式
Feb 26 Python
python线程池 ThreadPoolExecutor 的用法示例
Oct 10 Python
python 回调函数和回调方法的实现分析
Mar 23 #Python
python 时间戳与格式化时间的转化实现代码
Mar 23 #Python
python各种语言间时间的转化实现代码
Mar 23 #Python
Eclipse中Python开发环境搭建简单教程
Mar 23 #Python
在windows系统中实现python3安装lxml
Mar 23 #Python
Python使用Redis实现作业调度系统(超简单)
Mar 22 #Python
python编写简单爬虫资料汇总
Mar 22 #Python
You might like
php解析url的三个示例
2014/01/20 PHP
ThinkPHP模板Switch标签用法示例
2014/06/30 PHP
discuz目录文件资料汇总
2014/12/30 PHP
php自定义类fsocket模拟post或get请求的方法
2015/07/31 PHP
thinkPHP5实现数据库添加内容的方法
2017/10/25 PHP
jQuery 使用手册(七)
2009/09/23 Javascript
Js实现滚动变色的文字效果
2014/06/16 Javascript
jquery转盘抽奖功能实现
2015/11/13 Javascript
浅析javascript函数表达式
2016/02/10 Javascript
jQuery中队列queue()函数的实例教程
2016/05/03 Javascript
微信小程序 动态的设置图片的高度和宽度详解及实例代码
2017/02/24 Javascript
angularJS模态框$modal实例代码
2017/05/27 Javascript
基于jQuery的$.getScript方法去加载javaScript文档解析
2017/11/08 jQuery
解决vue-cli脚手架打包后vendor文件过大的问题
2018/09/27 Javascript
微信小程序基于Taro的分享图片功能实践详解
2019/07/12 Javascript
JS实现横向跑马灯效果代码
2020/04/20 Javascript
跟老齐学Python之数据类型总结
2014/09/24 Python
Python脚本实现自动发带图的微博
2016/04/27 Python
Django 使用Ajax进行前后台交互的示例讲解
2018/05/28 Python
PyCharm 2020 激活到 2100 年的教程
2020/03/25 Python
Tensorflow卷积实现原理+手写python代码实现卷积教程
2020/05/22 Python
澳大利亚婴儿喂养品牌:Cherub Baby
2018/11/01 全球购物
实习教师自我鉴定
2013/09/27 职场文书
学习十八大报告感言
2014/02/28 职场文书
作文评语集锦大全
2014/04/23 职场文书
大学生应聘求职信
2014/05/26 职场文书
护校行动方案
2014/05/31 职场文书
园林系毕业生求职信
2014/06/23 职场文书
电子商务优秀毕业生求职信
2014/07/11 职场文书
硕士论文致谢范文
2015/05/14 职场文书
退休教师追悼词
2015/06/23 职场文书
小学大队干部竞选稿
2015/11/20 职场文书
2019辞职报告范本3篇!
2019/07/23 职场文书
2019送给家人们的中秋节祝福语
2019/08/15 职场文书
Mysql中常用的join连接方式
2022/05/11 MySQL