AttributeError: 'Process' object has no attribute 'get_connections'

2,195 views
Skip to first unread message

Tac Tacelosky

unread,
Jul 19, 2015, 6:46:39 AM7/19/15
to psi...@googlegroups.com
I'm new to python and to psiturk, and am stuck on what I assume is a python configuration issue.  I'm trying to run this on Ubuntu 12.04.  Any suggestions?

tac@bonobo-1:/var/www/Posse/psiturk-example$ psiturk
Traceback (most recent call last):
  File "/usr/local/bin/psiturk", line 9, in <module>
    load_entry_point('PsiTurk==2.1.2', 'console_scripts', 'psiturk')()
  File "/usr/local/lib/python2.7/dist-packages/psiturk/command_line.py", line 14, in process
    launch_shell()
  File "/usr/local/lib/python2.7/dist-packages/psiturk/command_line.py", line 104, in launch_shell
    ps.run(cabinmode=args.cabinmode)
  File "/usr/local/lib/python2.7/dist-packages/psiturk/psiturk_shell.py", line 1780, in run
    config.getboolean('Shell Parameters', 'launch_in_sandbox_mode'))
  File "/usr/local/lib/python2.7/dist-packages/psiturk/psiturk_shell.py", line 507, in __init__
    PsiturkShell.__init__(self, config, server)
  File "/usr/local/lib/python2.7/dist-packages/psiturk/psiturk_shell.py", line 119, in __init__
    self.color_prompt()
  File "/usr/local/lib/python2.7/dist-packages/psiturk/psiturk_shell.py", line 571, in color_prompt
    server_status = self.server.is_server_running()
  File "/usr/local/lib/python2.7/dist-packages/psiturk/experiment_server_controller.py", line 144, in is_server_running
    psiturk_exp_ports = [process[0].laddr[1] for process in [psutil.Process(int(pid)).get_connections() for pid in output]]

AttributeError: 'Process' object has no attribute 'get_connections'

I'm running psutiil 3.1.1

tac@bonobo-1:~$ pip show psutil
---
Name: psutil
Version: 3.1.1
Location: /usr/local/lib/python2.7/dist-packages

Thanks,

Tac


Katie Koehler

unread,
Jul 20, 2015, 5:46:15 PM7/20/15
to psi...@googlegroups.com
I had this same problem and just followed the advice from a previous post to downgrade psutil.

This worked for downgrading:
sudo pip uninstall psutil
sudo pip install psutil==2.2.1

Todd Gureckis

unread,
Jul 26, 2015, 3:44:01 PM7/26/15
to Katie Koehler, psi...@googlegroups.com
there could be a simple pull request to fix this…
> --
> You received this message because you are subscribed to the Google Groups "PsiTurk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to psiturk+u...@googlegroups.com.
> To post to this group, send email to psi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/psiturk.
> For more options, visit https://groups.google.com/d/optout.

Paul Feitzinger

unread,
Jul 27, 2015, 12:17:26 PM7/27/15
to Todd Gureckis, Katie Koehler, psi...@googlegroups.com
On Sun, Jul 26, 2015 at 12:43:59PM -0700, Todd Gureckis wrote:
> there could be a simple pull request to fix this…

here: https://github.com/NYUCCL/psiTurk/pull/192

olew...@gmail.com

unread,
Nov 8, 2015, 3:55:43 PM11/8/15
to PsiTurk, todd.g...@nyu.edu
I'm still getting this error. I tried

(1) Installing from github, as suggested here, (including over http):
https://github.com/NYUCCL/psiTurk/pull/192

(2) Reverting to an older version of psutil, as suggested in this thread,

but no luck. Anything else I should try?


floria...@gmail.com

unread,
Mar 30, 2016, 5:15:21 PM3/30/16
to PsiTurk, todd.g...@nyu.edu, olew...@gmail.com
Hi,
I would like to point out that psiturk is not compatible with Ubuntu15/anaconda2 at the time of writing.
You cannot downgrad psutil with anaconda2 (you will have an error regarding dynamic libraries) and you cannot use the trunk psiturk2.1.0dev as suggested on other post.
The only solution I found is to install psiturk with the classic package python2 and to downgrad psutils.
Reply all
Reply to author
Forward
0 new messages