2012-07-07 101 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