2012-07-07 106 views
1

我在osx 10.7.4上运行virtualenv,并且我试图安装MongoDB for python,它是2.7.3版本。从pip安装pymongo后无法运行mongod命令

我刚刚从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 

谢谢你们!

+0

你在virtualenv中运行这个。你确定它没有修改你的路径,并使mongod无济于事。 mongod是否用来在你的virtualenv之外工作? – jdi 2012-07-07 05:08:06

回答

1

我想你可能会把python mongo驱动程序和mongo服务器本身搞混。

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

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

+0

是的,我刚刚安装了pymongo。我会自己安装mongodb,但不知道该命令是否重要。 – mepine 2012-07-07 13:34:20

+0

它应该没关系。 – 2012-07-07 16:17:40

+0

我安装了mongodb本身,它变成了完美的工作。谢谢Wes! – mepine 2012-07-10 05:52:24