从pip安装pymongo后无法运行mongod命令

2024-06-28 20:16:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我在OSX10.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

谢谢各位!!在


Tags: buildbinusrlocaltempx86macosxclang
1条回答
网友
1楼 · 发布于 2024-06-28 20:16:16

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

您是安装了mongodb(mongod、mongo等),还是仅仅安装了pymongo?在

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

相关问题 更多 >