文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

解决Python出现_warn_unsafe_extraction问题的方法

2022-06-04 19:10

关注

在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

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     807人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     351人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     314人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     433人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     221人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯