发布于 2016-05-08 04:25:10 | 331 次阅读 | 评论: 1 | 来源: 网友投递

这里有新鲜出炉的Python3 Cookbook中文版,程序狗速度看过来!

Python编程语言

Python 是一种面向对象、解释型计算机程序设计语言,由Guido van Rossum于1989年底发明,第一个公开发行版发行于1991年。Python语法简洁而清晰,具有丰富和强大的类库。它常被昵称为胶水语言,它能够把用其他语言制作的各种模块(尤其是C/C++)很轻松地联结在一起。


这篇文章主要为大家详细介绍了解决Python出现'_warn_unsafe_extraction'问题的方法,感兴趣的小伙伴们可以参考一下

在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 "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



最新网友评论  共有(1)条评论 发布评论 返回顶部
jyjo 发布于2016-07-09 17:31:08
成功,感谢分享
支持(0)  反对(0)  回复

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务