如何在Mac OS上通过pip安装mtools?

时间:2017-04-19 09:42:29

标签: python python-2.7

我按照此说明安装mtoolshttps://github.com/rueckstiess/mtools/blob/develop/INSTALL.md。我尝试了pip并从源代码构建但未能启动它。尝试启动mlaunch时出现以下错误。我看到这个错误与python有关,我不熟悉python。有没有人对这个错误有任何想法?

$ mlaunch
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/mlaunch", line 9, in <module>
    load_entry_point('mtools==1.2.4.dev0', 'console_scripts', 'mlaunch')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2697, in load_entry_point
    return ep.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2370, in load
    return self.resolve()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2376, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mtools-1.2.4.dev0-py2.7.egg/mtools/mlaunch/mlaunch.py", line 40, in <module>
    raise ImportError("Can't import pymongo. See http://api.mongodb.org/python/current/ for instructions on how to install pymongo.")
ImportError: Can't import pymongo. See http://api.mongodb.org/python/current/ for instructions on how to install pymongo.

1 个答案:

答案 0 :(得分:1)

跟踪状态中的错误消息:

  

ImportError:无法导入pymongo。有关如何安装pymongo的说明,请参阅http://api.mongodb.org/python/current/

这意味着您缺少名为pymongo的依赖项来运行mlaunch

您可以通过运行以下命令来安装pymongo

python -m pip install pymongo

有关如何安装pymongo的详细信息,请参阅官方文档:https://api.mongodb.com/python/current/installation.html