pandasql

1,255 views
Skip to first unread message

Vinit Krishna

unread,
Mar 20, 2015, 4:46:42 PM3/20/15
to spyd...@googlegroups.com
How do I install the pandasql package using the spyder IDE?  I am learning the Python language for statistical analysis of large databases and would like to run SQL queries on pandas DataFrames.

Adrian Klaver

unread,
Mar 20, 2015, 4:49:39 PM3/20/15
to spyd...@googlegroups.com
OS?
Spyder was installed how?
How do you normally install Python packages on your machine?


--
Adrian Klaver
adrian...@aklaver.com

Vinit Krishna

unread,
Mar 20, 2015, 8:28:23 PM3/20/15
to spyd...@googlegroups.com
Thanks for your reply.

My OS is Windows 8.1 64-bit.  Spyder was installed as part of the Anaconda package (Python 2.7.8 |Anaconda 2.1.0 (64-bit).  I haven't manually installed Python packages.  Instead, I've been using pre-installed packages but when i attempt to import pandasql, i get this message:

import pandas as pd

from pandasql import sqldf

Traceback (most recent call last):

  File "<ipython-input-5-740f6f3989c2>", line 1, in <module>
    from pandasql import sqldf

ImportError: No module named pandasql

Adrian Klaver

unread,
Mar 20, 2015, 8:41:38 PM3/20/15
to spyd...@googlegroups.com
On 03/20/2015 05:15 PM, Vinit Krishna wrote:
> Thanks for your reply.
>
> My OS is Windows 8.1 64-bit. Spyder was installed as part of the
> Anaconda package (Python 2.7.8 |Anaconda 2.1.0 (64-bit). I haven't
> manually installed Python packages. Instead, I've been using
> pre-installed packages but when i attempt to import pandasql, i get this
> message:
>
> import pandas as pd
>
> from pandasql import sqldf
>
> Traceback (most recent call last):
>
> File "<ipython-input-5-740f6f3989c2>", line 1, in <module>
> from pandasql import sqldf
>
> ImportError: No module named pandasql
>
>

Seems pandasql is in the Anaconda repos:

http://repo.continuum.io/pkgs/free/win-64/index.html

So you will need to use the conda package manager to install it.

--
Adrian Klaver
adrian...@aklaver.com

Vinit Krishna

unread,
Mar 21, 2015, 4:17:11 PM3/21/15
to spyd...@googlegroups.com
It worked, I was able to install pandasql and run SQL queries on my pandas dataframe.  Thank you for your help!

Vinit Krishna

unread,
Mar 21, 2015, 4:17:11 PM3/21/15
to spyd...@googlegroups.com
Thank you very much!  I no longer get the error message when I import sqldf from pandasql.

Johan Garzón

unread,
May 28, 2015, 5:14:38 PM5/28/15
to spyd...@googlegroups.com
Hi Vinit, I am having the same problem as you but can't manage to install pandasql, I tried as suuggested by Adrian using Conda but I still get an error, could you describe please how you imported pandasql using conda packae manager?

Vinit Krishna

unread,
Jun 1, 2015, 10:10:31 AM6/1/15
to spyd...@googlegroups.com
Hello Johan,

I had followed Adrian's suggestion, and used the conda package mangager....conda install pandasql.

What type of error message are you getting?

--
You received this message because you are subscribed to a topic in the Google Groups "spyder" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spyderlib/2Mo_MZlW2PU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Chris Howard

unread,
Jul 1, 2015, 6:04:27 PM7/1/15
to spyd...@googlegroups.com
In my Win7 os I went to Start | All Programs | Anaconda | Anaconda Command Prompt

In this shell, I typed conda install pandasql

 
Reply all
Reply to author
Forward
0 new messages