设置MongoDB课程环境
Setting Up Your Course Environment
This course is designed to be very hands on. Virtually all of the lectures have resources that can be downloaded so that you can follow along with the instructor. These resources are 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 of 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 that you download. And finally, there's the the mflix folder which will hold the mflix app that you'll download and install later in the course.
Jupyter Notebooks
Many of the resources you download will be Jupyter notebooks that you can run locally on your computer. The following sections will walk you through how to install and set up your Juyter notebook environment.
We're going to use 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 an 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 this environment by running:
source activate intro-to-mongodb # on Linux and macOS
activate 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 be able to point your browser to http://localhost:8888/ to access the Jupyter Notebook interface. Now, any notebooks (ipynb files) that you place in the notebooks directory will appear and be executable in this interface.
Installing Python Dependancies
You now have an environment set up where you can execute the handouts from the lectures and assessments. Some of the notebooks that you'll download will use 3rd party Python modules. A great example of this is pymongo, which is the Python module that allows your scripts to talk to a MongoDB database.
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 you'll want to install all the modules used in this course inside your Anaconda environment.
For example, if you wanted to install pymongo you'd do something like the following:
# This assumes your mongodb-analytics folder is stored in your home directory
cd ~/mongodb-analytics/intro-to-mongodb
source activate intro-to-mongodb # on macOS and Linux
activate intro-to-mongodb # on Windows
pip install pymongo dnspython
After executing the following commands you'll be able to use the pymongo module to connect your Jupyter notebooks to MongoDB!
设置MongoDB课程环境的更多相关文章
- 在 mongodb 终端环境下写多行 javascript 代码、函数
工作中碰到一个问题,需要把某个 collection 中的某些符合条件的数据取出来,逐行处理其中某些字段.mongodb 终端下支持直接写 js 代码.函数,也可以运行 js 文件.1 首先需要设置 ...
- MongoDB 生产环境笔记
目录 MongoDB 生产环境笔记 一.vm.zone_reclaim_mode 参数 二.添加 swap 分区 三.设置 swappiness 参数 四.内核和文件系统版本 五.禁用 Transpa ...
- OCM_第一天课程:OCM课程环境搭建
注:本文为原著(其内容来自 腾科教育培训课堂).阅读本文注意事项如下: 1:所有文章的转载请标注本文出处. 2:本文非本人不得用于商业用途.违者将承当相应法律责任. 3:该系列文章目录列表: 一:&l ...
- MongoDB Linux环境安装及配置[转]
CentOS 6.5系统中使用yum安装MongoDB 2.6 教程 CentOS 6.5系统中使用yum安装MongoDB 2.6 教程,本文共分5个步骤完成MongoDB的安装.下面我们在Cent ...
- 如何设置Java开发环境
傻瓜式 设置Java开发环境 跟我来. 对与win7操作系统.有两种方法. 第一种: 1.下载JDK,完成安装. 2.右键我的电脑,选择属性,在左边找到高级系统设置左键单击打开,在高级选项中找到 环境 ...
- 升级设置win2008r2开发环境,遇到问题小结
升级设置2008r2开发环境,是一般程序员经历的事情.许多从vs 2003,vs2005+sql2000+win2003过来,但是,时间推移,技术革新,64位的推行.架构的变化和强大.我们也只可以学习 ...
- [整理]DLL延时加载 && 设置进程私有环境变量
DLL延时加载鉴于静态和动态加载之间,即无需在代码中显示加载但它内队依然是动态加载的方式只是系统帮处理了.这样做好处是: 1. 可以加快启动时间(因为它是动态加载在需要的时间加载), 2. 减小编写L ...
- 【命令】Ubuntu设置和查看环境变量
转自[Ubuntu]Ubuntu设置和查看环境变量 查看环境变量 env env命令是environment的缩写,用于列出所有的环境变量 export 单独使用export命令也可以像env列出所有 ...
- python爬虫之MongoDB测试环境安装
一. 下载 从http://www.mongodb.org/downloads地址中下载:mongodb-linux-x86_64-2.4.11.tar 二. 安装 1>设置mongoDB ...
随机推荐
- Python错误TypeError: write() argument must be str, not bytes
2016-07-03 20:51:25 今天使用Python中的pickle存储的时候出现了以下错误: TypeError: write() argument must be str, not byt ...
- LG2120 [ZJOI2007]仓库建设
题意 L公司有N个工厂,由高到底分布在一座山上. 工厂1在山顶,工厂N在山脚. 由于这座山处于高原内陆地区(干燥少雨),L公司一般把产品直接堆放在露天,以节省费用. 突然有一天,L公司的总裁L先生接到 ...
- EMMC架构
现在EMMC盛行,分析总结还是很有必要的.以下以全志a64为实例切入主题. 这里a64有三个sdc0~2,硬件上sdc2是连接EMMC,这里只分析sdc2的代码. 初始化的代码在linux-3.10/ ...
- Android Theme的使用
原文地址 http://www.cnblogs.com/Dentist/p/4369816.html Theme是一套UI控件和Activity的样式.可以给Application 和 activit ...
- Diffie-Hellman 密钥交换
假定有两个全局公开的参数,分别为一个素数p和一个整数g,g是p的一个原根,为了协商共享的会话密钥: 首先,用户A随机选取a,计算出A = g^a mod p,并将A发送给B:然后,用户B随机选取b,计 ...
- jetty中war包解压路径
这是个很奇怪的问题,如果下载好了jetty直接放入war包运行,项目会被解压到C盘的临时文件夹中.但是如果你在${JETTY_HOME}文件夹,也就是jetty解压后的根目录中新建,注意是新建一个wo ...
- unittest--unittest.defaultTestLoader()的方法
unittest.defaultTestLoader(): defaultTestLoader()类,通过该类下面的discover()方法可自动更具测试目录start_dir匹配查找测试用例文件(t ...
- pytest命令行选项
-m 标记 代码加一个装饰器:@pytest.mark.run_bbc_test,命令行添加 -m run_bbc_test,执行带@pytest.mark.run_bbc_test的测试用例: -k ...
- mysql事务之一:MySQL数据库事务隔离级别(Transaction Isolation Level)及锁的实现原理
一.数据库隔离级别 数据库隔离级别有四种,应用<高性能mysql>一书中的说明: 然后说说修改事务隔离级别的方法: 1.全局修改,修改mysql.ini配置文件,在最后加上 1 #可选参数 ...
- WIN10运行软件,窗口不显示(移动到屏幕外无法复原)的解决办法 Lebal:bug10解决方案
双显示器切换回单显示器的时候,可能会遇到窗口移动到屏幕外不显示的情况 像这样虽然有缩略图但是点击无反应,并且平铺窗口也不管用,这个时候单击该窗口,Alt+space 执行最小化以及最大化操作即可复原