psiTurk:AttributeError:'Process'对象没有属性'get_connections'

时间:2015-09-29 16:20:36

标签: python-2.7 openshift

在开始之前,让我给出免责声明,我在这方面很新,我的解释可能不太一致,而且我没有能力将可能重要的内容分开。

我想运行psiTurk。但是因为psiturk在Windows上不起作用,我使用Openshift来运行Python,其中包含psiturk。我已经使用PuTTY工作了Openshift,并且已经启动了psiTurk shell。但即使我输入命令打开服务器,服务器仍保持关闭,并显示以下错误消息。

[psiTurk server:off mode:sdbx #HITs:0]$ server on
Experiment server launching...
Now serving on myurl.rhcloud.com
Traceback (most recent call last):
File "/var/lib/openshift/[my SSH]/python/virtenv/lib/python2.7/site-packages/cmd2.py", line 789, in onecmd_plus_hooks
stop = self.postcmd(stop, statement)
File "/var/lib/openshift/[my SSH]/python/virtenv/lib/python2.7/site-packages/psiturk/psiturk_shell.py", line 205, in postcmd
self.color_prompt()
File "/var/lib/openshift/[my SSH]/python/virtenv/lib/python2.7/site-packages/psiturk/psiturk_shell.py", line 571, in color_prompt
server_status = self.server.is_server_running()
File "/var/lib/openshift/[my SSH]/python/virtenv/lib/python2.7/site-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'
'Process' object has no attribute 'get_connections'

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

似乎标准pip install psiturk安装了与psutil不兼容的psiturk库的版本。对我有用的是直接从git安装:

pip install git+git://github.com/NYUCCL/psiTurk.git@master

有关详细信息,请参阅此PR:https://github.com/NYUCCL/psiTurk/pull/192

此外,最好制作一个virtualenv以避免已经安装的软件包出现问题。