How to install pymongo

I am currently trying to install the MongoDB driver for Python on my Mac OS X (mavericks).

But when I started

[ Dsl ~/Documents/python ] sudo easy_install pymongo 

I get the following output

 Searching for pymongo Best match: pymongo 2.7 Processing pymongo-2.7-py2.7-macosx-10.9-intel.egg Removing pymongo 2.7rc1 from easy-install.pth file Adding pymongo 2.7 to easy-install.pth file Using /Library/Python/2.7/site-packages/pymongo-2.7-py2.7-macosx-10.9-intel.egg Processing dependencies for pymongo Finished processing dependencies for pymongo 

I try many different commands, but nothing works. How to install pymongo?

thanks for the help

Edit: when i try to use it in python script

 #!/usr/bin/env python3 import pymongo client = MongoClient() 

I have this error

 Traceback (most recent call last): File "./mongo.py", line 2, in <module> import pymongo ImportError: No module named 'pymongo' 
+5
source share
9 answers

Try these commands. A source

 $ easy_install -U setuptools $ python -m easy_install pymongo 
+6
source

I have the same error, and I can fix it with the following command.

 sudo pip3 install pymongo sudo apt-get install python3-pip 

Try it. but this command is for Ubuntu 14.04 OX. not sure if this is work in Max OS X.

+3
source

Installing pymongo is easy

Make sure python is already installed on your computer. If you do not install here for quick installation.

CentOS

Update with yum

 yum -y update 

Download pip using curl:

 curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" 

Install pip command with python

 python get-pip.py 

Install pymongo using pip

 pip install pymongo 
+2
source
 python3 -m pip install pymongo 

worked for me on OS X

+1
source

you can use these commands

 python -m pip install pymongo 

To get a specific version of pymongo:

 $ python -m pip install pymongo==3.1.1 

To upgrade using pip:

 $ python -m pip install --upgrade pymongo 

To use easy_install from setuptools, do:

 $ python -m easy_install pymongo 

To upgrade, do:

 $ python -m easy_install -U pymongo 
0
source

I think you can download the .egg file here and install using

 sudo easy_install //filename 
0
source
 For ubuntu , you can try... sudo pip3 install pymongo sudo apt-get install python3-pip 

It works for me

-1
source

I am running python 2.7.12 on Rasbian Jesse. After launch:

 pip install pymongo 

The following command shows that the pymongo module exists in / usr / local / lib / python 2.7 / dist-packages /

 pip show pymongo 

One method that works is to add the sys path to the location of the pymongo module:

 import sys sys.path.append('/usr/local/lib/python2.7/dist-packages/') import pymongo 
-1
source

Source: https://habr.com/ru/post/1204112/


All Articles