0

I am learning how to use the new Jupyter. I want to install packages:BeautifulSoup, mrjob, pattern, and seaborn on python 2.7. I first tried to do so by running pip install BeautifulSoup mrjob pattern seaborn That all returns: SyntaxError: invalid syntax

I also tried from bs4 import BeautifulSoup, it did work for Beautifulsoup. But I still don't know how to install other packages.

Wondering anyone know why there was syntax error for using pip install? Is that because I haven't installed pip on python 2.7?

enaJ
  • 1,565
  • 5
  • 16
  • 29
  • Sounds like you're running `pip` from inside Jupyter. It's a command line program, so you should run it from a terminal. – mwaskom Apr 21 '15 at 01:01

4 Answers4

2

I was also able to install these packages from iphython notebook window by running

import pip    
def install(package):
   pip.main(['install', package])

install('BeautifulSoup4')
enaJ
  • 1,565
  • 5
  • 16
  • 29
0

Have you tried installing one package at a time. This helps you find which installation command not working.

You can find Julia packages here.

Aaron
  • 13
  • 3
  • I did install them one at each time, so that is not the problem. But still thank you. – enaJ Apr 21 '15 at 14:38
0

The problem was I was running pip from inside Jupyter. However, Jupyter is a command line program. Thanks to Mwaskom, the solution is run it from a terminal using:

pip install BeautifulSoup mrjob pattern seaborn
enaJ
  • 1,565
  • 5
  • 16
  • 29
0

You could try:

!pip install BeautifulSoup mrjob pattern seaborn
Quy Nguyen
  • 124
  • 2
  • 10