Jupyter: install new modules
Asked Answered
B

3

13

I have recently installed Anaconda with Python 3.5 and all the rest. I come from R where I am used to install packages dynamically. I am trying to install a module called scitools through jupyter notebook. I would like to recreate this in jupyter. However, I don't know how to dynamically install packages (if it's possible). I would greatly appreciate your help. Thank you!

enter image description here

EDIT: I am trying to use conda as recommended by the community, but it's not working. I am using mac OSX

enter image description here

Bumgarner answered 29/11, 2016 at 23:4 Comment(0)
T
19

Check Jake Vander Plus Blog here to learn how to install a package with pip from Jupyter Notebook.

# Install a pip package in the current Jupyter kernel
import sys
!{sys.executable} -m pip install numpy
Trident answered 18/10, 2018 at 18:40 Comment(2)
On windows this throws an error: 'C:\Program' is not recognized as an internal or external command, operable program or batch file.Cairn
Please share the actual command you ran.. It seems you ran a command that starts with C:\Program with a space.Trident
P
5

So if you have already done the install with anaconda, you may already have the module installed. In that case in your jupyter notebook after you have activated your kernel, you just need to make sure you execute the import statement.

import scitools

If you haven't installed that module yet, you can install it one of two ways. Both work from your command line or terminal.

pip install scitools

or since you have Anaconda

conda install scitools

and that should do it. Your import statement in your notebook when executed should correctly locate and enable the use of that module.

Pieria answered 29/11, 2016 at 23:10 Comment(0)
A
1

I had the same issue. It turns out if you open an anaconda window, which in Windows is accessible under the Anaconda drop down, it points to the correct location to install (or update) using pip.

Athabaska answered 30/5, 2018 at 16:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.