ImportError:无法从部分初始化的模块“ psutil”中导入名称“ _psutil_osx”

时间:2019-11-08 02:11:47

标签: python macos

执行python脚本文件时发生错误。

python版本是2.7.10

Traceback (most recent call last):
  File "/Users/zl96/Sites/mobileSMSPythonv2/mobileSMS/mobileSMSlocal.py", line 17, in <module>
    import psutil   #to get process memory usage
  File "/Users/zl96/Sites/mobileSMSPythonv2/mobileSMS/psutil/__init__.py", line 151, in <module>
    from . import _psosx as _psplatform
  File "/Users/zl96/Sites/mobileSMSPythonv2/mobileSMS/psutil/_psosx.py", line 16, in <module>
    from . import _psutil_osx as cext
ImportError: cannot import name '_psutil_osx' from partially initialized module 'psutil' (most likely due to a circular import)

1 个答案:

答案 0 :(得分:0)

这是我解决问题的方法:我从站点程序包中删除了名称为psutil的所有文件夹。

pip install psutil

然后我得到了错误消息:

ModuleNotFoundError: No module named 'aem.ae'

根据本网站的建议: xlwings 0.6.1 Import error on Mac OS X with python 3.5

然后我输入:

pip uninstall appscript
pip install appscript

解决了。