I am trying to input this command:

example = pd.read_excel('080615_gene_expression.xlsx' , index_col = 0)

but I get this error:

-bash: syntax error near unexpected token `('

I have tried changing quotes, spaces etc = no change

The command works in IPython 3.0.0.

closed as off-topic by karel, Pilot6, zwets, Andrea Corbellini, Amith KK Aug 15 '15 at 15:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – karel, Pilot6, zwets, Amith KK
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Are you sure you are typing the command inside a python / ipython shell? it sounds like you are typing it into a bash shell instead. – steeldriver Aug 14 '15 at 0:22
  • I solved it. AND YES you were correct! Rookie starting out here. Thanks! – Cris_Mar Aug 14 '15 at 0:45
  • As you're a new user: if you found an answer to your question, don't forget to click the grey ☑ under the "0" to the left of it to accept it, which means "yes, this answer is valid"! – David Foerster Aug 15 '15 at 9:03

If I start your command in a bash, I get an interesting

bash: syntax error near unexpected token `('

Start a Python interpreter by typing pythonEnter and then try the command again ;)

In my case, I get a

IOError: [Errno 2] No such file or directory: '080615_gene_expression.xlsx'

but in my case that's absolutely normal as I don't have your excel sheet.


This is a Python command, not a Bash command. You can run a Python shell and then run your code by hand by typing:


If you get an error that ipython command was not found, install it via:

pip install ipython

If you're putting this into a script and trying to run it from the shell, your Python script needs to start with (first line of the file):

#!/usr/bin/env python

Then you can run it from Bash as:

chmod +x my_script

Not the answer you're looking for? Browse other questions tagged or ask your own question.