MongoDB in Python Anaconda
<p>I am trying to setup MongoDB on an Anaconda Python environment.  While in the conda environment I ran <code>conda install -c anaconda mongodb=2.4.6</code> but once i try to run the command <code>service mongodb start</code> the command cannot be found.  Also when I run <code>mongod</code> I get something about <code>/data/db</code>path does not exist for the dpath.  How does MongoDB on Anaconda work? Did I install it correctly?</p>

<p>I am running on osx 10.11.</p>

<p><code>mongod</code> command outputs:</p>

<pre><code>mongod --help for help and startup options
Sun May  8 19:08:00.893 [initandlisten] MongoDB starting : pid=6765 port=27017 dbpath=/data/db/ 64-bit host=Roberts-MBP
Sun May  8 19:08:00.893 [initandlisten] 
Sun May  8 19:08:00.893 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Sun May  8 19:08:00.893 [initandlisten] db version v2.4.6
Sun May  8 19:08:00.893 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
Sun May  8 19:08:00.893 [initandlisten] build info: Darwin bs-osx-106-x86-64-2.10gen.cc 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Sun May  8 19:08:00.893 [initandlisten] allocator: system
Sun May  8 19:08:00.893 [initandlisten] options: {}
Sun May  8 19:08:00.895 [initandlisten] exception in initAndListen: 10296 
*********************************************************************
 ERROR: dbpath (/data/db/) does not exist.
 Create this directory or give existing directory in --dbpath.
 See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************
, terminating
Sun May  8 19:08:00.895 dbexit: 
Sun May  8 19:08:00.895 [initandlisten] shutdown: going to close listening sockets...
Sun May  8 19:08:00.895 [initandlisten] shutdown: going to flush diaglog...
Sun May  8 19:08:00.895 [initandlisten] shutdown: going to close sockets...
Sun May  8 19:08:00.895 [initandlisten] shutdown: waiting for fs preallocator...
Sun May  8 19:08:00.895 [initandlisten] shutdown: lock for final commit...
Sun May  8 19:08:00.895 [initandlisten] shutdown: final commit...
Sun May  8 19:08:00.895 [initandlisten] shutdown: closing all files...
Sun May  8 19:08:00.895 [initandlisten] closeAllFiles() finished
Sun May  8 19:08:00.895 dbexit: really exiting now`
</code></pre>

<p><code>sudo service mongodb start</code> command outputs:</p>

<pre><code>-bash: service: command not found
</code></pre>

<p>And here are additional errors when I try running pymongo within anaconda python environment.  I tried to create a database, and return the name of the new database, but returned an error.</p>

<pre><code>&gt;&gt;&gt; import  pymongo
&gt;&gt;&gt; from pymongo import MongoClient
&gt;&gt;&gt; client = MongoClient()
&gt;&gt;&gt; client.database_names()
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "//anaconda/envs/py2/lib/python2.7/site-packages/pymongo/mongo_client.py", line 1027, in database_names
    "listDatabases")["databases"]]
  File "//anaconda/envs/py2/lib/python2.7/site-packages/pymongo/database.py", line 478, in command
    with client._socket_for_reads(read_preference) as (sock_info, slave_ok):
  File "//anaconda/envs/py2/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "//anaconda/envs/py2/lib/python2.7/site-packages/pymongo/mongo_client.py", line 752, in _socket_for_reads
    with self._get_socket(read_preference) as sock_info:
  File "//anaconda/envs/py2/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "//anaconda/envs/py2/lib/python2.7/site-packages/pymongo/mongo_client.py", line 716, in _get_socket
    server = self._get_topology().select_server(selector)
  File "//anaconda/envs/py2/lib/python2.7/site-packages/pymongo/topology.py", line 142, in select_server
    address))
  File "//anaconda/envs/py2/lib/python2.7/site-packages/pymongo/topology.py", line 118, in select_servers
    self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 61] Connection refused
</code></pre>