Setting up a MONGODB course environment

Source: Internet
Author: User
Tags mongodb jupyter jupyter notebook

Setting up Your Course Environment

This course are designed to being very hands on. Virtually all of the lectures has resources that can follow along with the instructor. These resources is listed below the lecture video underneath "Downloads".

Prerequisites

Before following the instructions below you should make sure you ' ve completed the following prerequisites.

    • Created an Atlas free-tier Cluster
    • Installed MongoDB on Windows, OSX, or Linux.
Course Directory Structure

You'll likely be downloading many files as you progress through the course. To keep all the these files organized we suggest you create a folder structure like so:

. └──mongodb-Analytics    └──intro-to-mongodb        ├──mflix        └──notebooks

The "Mongodb-analytics" folder is used to segment the different courses in this specialization. So you can create a folder inside of that called "Intro-to-mongodb" for this course ' s downloadable resources. The Notebooks folder is for all of the notebooks and datasets so you download. And finally, there's the the The Mflix folder which would hold the Mflix app so you'll download and install later in the Cour Se.

Jupyter Notebooks

Many of the resources you download would be Jupyter notebooks so can run locally on your computer. The following sections would walk you through how to install and set up your Juyter notebook environment.

We ' re going to the use of Anacanoda to install Python 3 and to manage our Python environment. You can download Anaconda from their download site. After downloading the installer you can run it to install Python 3 and Anaconda ' s commandline tools.

You'll want to create a Anaconda environment for all your Python dependancies. Run This command from inside the intro-to-mongodb folder.

Conda Create-n Intro-to-mongodb

You can then activate the environment by running:

SOURCE Activate intro-to-MongoDB # on Linux and macosactivate intro-to-mongodb # on Windows

Then from inside your notebooks directory you can run the following command to start your Jupyter notebook:

Jupyter Notebook

From there, you should is able to point your browser to http://localhost:8888/to access the Jupyter Notebook interface. Now, any notebooks (IPYNB files) so you place in the Notebooks directory would appear and be executable in this Interface.

Installing Python dependancies

You are now having an environment set up where can execute the handouts from the lectures and assessments. Some of the notebooks that's you ll download'll use 3rd party Python modules. A Great example of Pymongo, which is the Python module, the allows your scripts to talk to a MongoDB data Base.

To install 3rd party Python modules you'll use the pip Command, which is installed alongside Python via Anaconda. By default, PIP installs Python modules globally. To prevent polluting your global Python environment "ll want to install all the modules used in this course inside your Anaconda environment.

For example, if you wanted to install Pymongo "do something like the following:

in ~/mongodb-analytics/intro-to-mongodbsource activate intro-to-MongoDB # on MacOS and Linuxactivate intro-to-install Pymongo Dnspython

After executing the following commands you'll be able to use the Pymongo module to connect your Jupyter notebooks to Mongo Db!

Setting up a MONGODB course environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.