Shyam R
Shyam R

Reputation: 483

import unicodecsv fails in jupyter

I tried to run import unicodecsv within jupyter by running a .ipynb file. It failed. Then I installed the unicodecsv file through the python install command and found it within c\python27 dir. But still the import did not happen. How should it be installed. Does it need to be placed within the anaconda installation

Edit : Error displayed -

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-9c1521d8df38> in <module>()
      2 #                 1                 #
      3 #####################################
----> 4 import unicodecsv
      5 ## Read in the data from daily_engagement.csv and project_submissions.csv
      6 ## and store the results in the below variables.

ImportError: No module named unicodecsv

Upvotes: 4

Views: 10327

Answers (5)

alex.b
alex.b

Reputation: 1528

Pip (Package Installer for Python) package manager also comes with Python3, you can try this variant without installing Conda (Windows):

python -m pip install unicodecsv

Upvotes: 7

ode2k
ode2k

Reputation: 2723

You should install it (from the command prompt) using:

conda install unicodecsv

Upvotes: 1

fred.chettouh
fred.chettouh

Reputation: 1

I had the same issue. Switching to Python 3 requires you to learn the new syntax and the rest of the nanodegree uses Python 2.

Make sure you are running the notebook in the same environment you are installing the the unicodecsv package in. Then:

 conda install unicodecsv 

should work. It did for me.

Upvotes: 0

mjeshtri
mjeshtri

Reputation: 263

I had the same problem for the same file at Udacity.

Try changing the Kernel from Python2 to Python3 in the Kernel -> Change Kernel menu.

Hope that helps :)

Upvotes: 1

Gullal
Gullal

Reputation: 1

Install unicodecsv using:

sudo pip install unicodecsv

Restart/run your notebook again.

Upvotes: 0

Related Questions