12

I'm trying to read a file using python and I keep getting this error

ERROR: Line magic function `%user_vars` not found.

My code is very basic just

names = read_csv('Combined data.csv')
names.head()

I get this for anytime I try to read or open a file. I tried using this thread for help.

ERROR: Line magic function `%matplotlib` not found

I'm using enthought canopy and I have IPython version 2.4.1. I made sure to update using the IPython installation page for help. I'm not sure what's wrong because it should be very simple to open/read files. I even get this error for opening text files.

EDIT:

I imported traceback and used

 print(traceback.format_exc())

But all I get is none printed. I'm not sure what that means.

Community
  • 1
  • 1
Rima
  • 299
  • 2
  • 4
  • 10
  • 1
    You don't have IPython version 2.7.9. You have *Python* version 2.7.9. The latest version in IPython's 2.x series was 2.4.1, then it jumped to 3.0. Please [edit] your question to indicate the exact version of IPython you're using. – MattDMo Jul 30 '15 at 23:27
  • 3
    Probably it won't apply to everyone but I just got this error after Kernel got crushed.(forcing to close `pythonw` using task manager). So I closed and reopened the Canopy and everything worked fine. – Lafexlos Mar 17 '16 at 10:50

1 Answers1

0

Looks like you are using Pandas. Try the following (assuming your csv file is in the same path as the your script lib) and insert it one line at a time if you are using the IPython Shell:

import pandas as pd 
names = pd.read_csv('Combined data.csv')
names.head()
LemonPy
  • 500
  • 4
  • 12