installing pandas module?

446 views
Skip to first unread message

Cecilia Westbrook

unread,
Jan 18, 2013, 4:51:03 PM1/18/13
to psychop...@googlegroups.com
Hi,

I was looking around on the website for instructions about how to install additional modules, and I couldn't find any.

I tried installing the pandas module using easy_install, and kept getting the error that it is dependent on numpy >= 1.6.1, which I have installed (as part of the PsychoPy installation). My guess is that terminal was calling one of the other (older) python installations I have on my mac. Is there a straightforward way to install pandas into the python folder within the PsychoPy contents?

Jonathan Peirce

unread,
Jan 19, 2013, 6:23:32 AM1/19/13
to psychop...@googlegroups.com
Hi cecilia,

Your intuition is right - easy_install would have tried to install
pandas into your other python, not the standalone psychopy installation.
There isn't exactly a way to add extra packages /into/ the psychopy
installation and I don't really intend to add that, but it is possible
to have psychopy include packages that are installed elsewhere.

BUT... as it happens I'm building a new Standalone suite at the moment
and I think adding pandas (and probably pytables) seems sensible as,
good general packages for science. So if you can wait a few days this
will be done for you! How desperate is it?

Jon
> --
> You received this message because you are subscribed to the Google
> Groups "psychopy-users" group.
> To post to this group, send email to psychop...@googlegroups.com.
> To unsubscribe from this group, send email to
> psychopy-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/psychopy-users/-/g-s-BFpwEoAJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/

Cecilia Westbrook

unread,
Jan 19, 2013, 3:56:57 PM1/19/13
to psychop...@googlegroups.com
Not so desperate that it can't wait a few days! That is great news, thanks so much :)

In case this is helpful to anyone else: I was finally able to install pandas into my system's python library by upgrading python, installing numpy, and then also installing gcc (Apple's Developer page: xcode command line tools). Once I got pandas installed I updated psychopy paths to include the site-packages folder of my system install (Preferences > paths), so now psychopy can find the module, but it has an import error. I think this is because my system install is python 2.7, and the psychopy standalone version is 2.6. I'm guessing I could fix it if I installed python2.6 and manually installed a pandas module there, and then pointed psychopy at it. But at that point it'd probably be easier just to manually re-install psychopy! I'll probably do that eventually anyway...

Ceci

Steven Vannoy

unread,
Dec 2, 2014, 5:01:29 PM12/2/14
to psychop...@googlegroups.com
Hi,

Well, nearly a year later, I've run into what looks like a similar problem, except my error message is saying pkg_resources.VersionConflict: (numpy 1.6.2 (....), Requirement.parse ('numpy>=1.7.0')

Maybe it isn't the same problem, but in any event I can't get pandas installed and I have a script that uses it. I was able to get this running on my other Mac, it is running 10.10.1 whereas this one is running 10.9.5; before I just upgrade this Mac, I'd like to understand this problem better. I'm new to Python and PsychoPy (which is awesome) so on the steep learning curve.

Thanks
Steven

Alex Holcombe

unread,
Dec 3, 2014, 2:42:59 AM12/3/14
to psychop...@googlegroups.com
Steven, maybe you're dependent on using psychopy outside the app, but in case you didn't realize it, if you use stand-alone Psychopy, pandas is now included. 
That is, you can "import pandas" from one of your scripts.

Alex

Steven D. Vannoy

unread,
Dec 3, 2014, 8:04:06 AM12/3/14
to psychop...@googlegroups.com
Thanks for the quick response.

I think I am confusing terms. I said “script”, but what I have is a file with python code (I’m working with the practical iat example provided with psychopy, and there is a scoring “script”? what is the proper term?) So when I run that via 
% python scoreIAT.py datafile

I get the error indicating I need panda installed.

I hope this helps clarify my question, I see  it is not actually a psychopy question, it is a python question and I’m happy to move over to a python site to pursue the answer.

Steven

*****************************
@stevenvannoy



--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/myzglD3CaDA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.

To post to this group, send email to psychop...@googlegroups.com.

Jeremy Gray

unread,
Dec 3, 2014, 8:25:23 AM12/3/14
to psychop...@googlegroups.com
I think I am confusing terms. I said “script”, but what I have is a file with python code (I’m working with the practical iat example provided with psychopy, and there is a scoring “script”? what is the proper term?)

script or code, either way. I think people tend to use "script" to mean a stand alone file containing code that you run from the command line. And script implies that its interpreted at execution time, rather than code that is compiled first.
 
So when I run that via 
% python scoreIAT.py datafile

I get the error indicating I need panda installed.

I hope this helps clarify my question, I see  it is not actually a psychopy question, it is a python question and I’m happy to move over to a python site to pursue the answer.

Yeah, from the command line you are invoking the system python, which does not have python by default.

If you open the scoring script in the PsychoPy coder, then you can run it using the python that comes with PsychoPy (and has pandas too). But you cannot use the sys.argv notation, and so have to arrange for something else. The simplest way is to hardcode it right in the scoreIAT.py file, like adding a line (and removing the if __name__ == '__main__' stuff):

print scoreIAT('1_2014_Dec_01_2128.csv')

and the results get printed to the output window. I get a warning about openpyxl version, followed by:

-0.255080721043

 
Reply all
Reply to author
Forward
0 new messages