1

我在 osx 10.7.4 上运行 virtualenv,我试图安装 MongoDB for python,它是 2.7.3 版本。

我刚刚从 pip 安装它,并试图看看如果我运行 mongod 命令会发生什么,但事实证明我无法运行该命令。

以下是我的终端发生的事情,有人可以在这里帮忙看看可能出了什么问题吗?

(test1)Dus-MacBook-Air:~ mepine$ pip install pymongo
Downloading/unpacking pymongo
  Downloading pymongo-2.2.1.tar.gz (230Kb): 230Kb downloaded
  Running setup.py egg_info for package pymongo

Installing collected packages: pymongo
  Running setup.py install for pymongo
    building 'bson._cbson' extension
    /usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/_cbsonmodule.c -o build/temp.macosx-10.4-x86_64-2.7/bson/_cbsonmodule.o
    /usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/time64.c -o build/temp.macosx-10.4-x86_64-2.7/bson/time64.o
    /usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/buffer.c -o build/temp.macosx-10.4-x86_64-2.7/bson/buffer.o
    /usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/encoding_helpers.c -o build/temp.macosx-10.4-x86_64-2.7/bson/encoding_helpers.o
    /usr/bin/clang -bundle -undefined dynamic_lookup -L/usr/local/Cellar/readline/6.2.2/lib build/temp.macosx-10.4-x86_64-2.7/bson/_cbsonmodule.o build/temp.macosx-10.4-x86_64-2.7/bson/time64.o build/temp.macosx-10.4-x86_64-2.7/bson/buffer.o build/temp.macosx-10.4-x86_64-2.7/bson/encoding_helpers.o -o build/lib.macosx-10.4-x86_64-2.7/bson/_cbson.so
    building 'pymongo._cmessage' extension
    /usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c pymongo/_cmessagemodule.c -o build/temp.macosx-10.4-x86_64-2.7/pymongo/_cmessagemodule.o
    /usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibson -I/usr/local/Cellar/python/2.7.3/include/python2.7 -c bson/buffer.c -o build/temp.macosx-10.4-x86_64-2.7/bson/buffer.o
    /usr/bin/clang -bundle -undefined dynamic_lookup -L/usr/local/Cellar/readline/6.2.2/lib build/temp.macosx-10.4-x86_64-2.7/pymongo/_cmessagemodule.o build/temp.macosx-10.4-x86_64-2.7/bson/buffer.o -o build/lib.macosx-10.4-x86_64-2.7/pymongo/_cmessage.so

Successfully installed pymongo
Cleaning up...
(test1)Dus-MacBook-Air:~ mepine$ mongod
-bash: mongod: command not found

多谢你们!!

4

1 回答 1

1

我想也许您将 python mongo 驱动程序与 mongo 服务器本身混淆了。

你安装了 mongodb(mongod、mongo 等),还是只安装了 pymongo?

有一个用于 mongodb 的自制软件包,以防万一您想要一种简单的方法来安装它——或者您可以直接从http://www.mongodb.org/downloads下载它。

于 2012-07-07T05:19:46.283 回答