Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] OpenSesame with Pygaze has a circular import in Mac.

rrrrrr
edited January 2016 in OpenSesame

Hello,

I have some suggestion about using OpenSeasame with Pygaze in MacOS.
Probably, I found some critical problem.

When using OpenSesame in Mac, it seems that Pygaze is imported from '/usr/local/lib/python2.7/site-packages/' even if the path of python is made to other directories.
So, there is no error (e.g., OSError: [Errno 2] No such file or directory: 'resources/fonts') after copying Pygaze into it.

Almost problem can be solved, but it may still has a different bug as below .

Traceback:
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libopensesame/inline_script.py", line 102, in run
    self.experiment.python_workspace._exec(self.crun)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libopensesame/python_workspace.py", line 160, in _exec
    exec(bytecode, self._globals)
  File "<string>", line 6, in <module>
  File "/usr/local/lib/python2.7/site-packages/pygaze/__init__.py", line 22, in <module>
    from pygaze.settings import settings
  File "/usr/local/lib/python2.7/site-packages/pygaze/settings.py", line 59, in <module>
    settings = Settings()
  File "/usr/local/lib/python2.7/site-packages/pygaze/settings.py", line 27, in __init__
    from pygaze import defaults
ImportError: cannot import name defaults

It shows that Pygaze includes a circular import.

Comments

  • edited November 2015

    Hi,

    I'm not familiar with your Python environment, but as a general tip: Python just takes the first matching thing from the Python path. In your case, this is apparently pygaze from site-packages. If you want to use a different pygaze, you can either remove the one from site-packages, or adjust the PYTHON_PATH. There's a neat (hidden) trick in OpenSesame to do this. If you create a file called environment.yaml (in the working direction of OpenSesame) you can specify where OpenSesame looks for Python modules and plugins. (The custom Python path will be prepended, so it will take precedence over the existing Python path.)

    PYTHON_PATH: /my/path/to/pygaze
    OPENSESAME_PLUGIN_PATH: /my/path/to/plugins
    OPENSESAME_EXTENSION_PATH: /my/path/to/extensions
    

    It shows that Pygaze includes a circular import.

    Where do you see a circular import?

    Just as a disclaimer: You are in pretty rough territory here: PyGaze 0.6.0 is under active development, and neither Edwin nor me uses Mac OS. But it's great that you're using it, because it will help us catch bugs. But

    Cheers,
    Sebastiaan

  • rrrrrr
    edited 6:04PM

    Hello,

    Thank you for your reply, and sorry for my many questions.

    I am trying to make a 'environment.yaml'.
    Which the 'plugins' should I use? Where should I put 'opensesame_plugins'?
    There are several plugins folder; plugins in Pygaze and in OpenSesame.

    Best,

  • edited 6:04PM

    The plugins that are bundled with PyGaze (in the folder opensesame_plugins) need to be somewhere OpenSesame can find them. To do so, you can add that folder (the full path to opensesame_plugins to the OPENSESAME_PLUGIN_PATH). Something like:

    OPENSESAME_PLUGIN_PATH: /my/path/to/pygaze/opensesame_plugins
    

    Does that make sense?

  • rrrrrr
    edited 6:04PM

    Hello sebastiaan,

    I added the path to OPENSESAME_PLUGIN_PATH, but I was not able to open Pygaze eye-tracking template in OpenSeasame because the error occurred when I tried to open it.

    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libqtopensesame/qtopensesame.py", line 677, in open_file
        experiment_path=os.path.dirname(path))
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libqtopensesame/items/experiment.py", line 80, in __init__
        fullscreen=None)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libopensesame/experiment.py", line 168, in __init__
        item.item.__init__(self, name, self, string)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libopensesame/item.py", line 68, in __init__
        self.from_string(string)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libopensesame/experiment.py", line 325, in from_string
        self.items.new(item_type, item_name, def_str)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libqtopensesame/misc/qtitem_store.py", line 83, in new
        item = super(qtitem_store, self).new(_type, name=name, script=script)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSesame-release-3.0.2/libopensesame/item_store.py", line 176, in new
        fromlist=[u'dummy'])
    ImportError: No module named pygaze_drift_correct
    

    I already changed the codes of 'pygaze_init.py'; from dummy to Eyelink.

    Should I change any other setting?

    Best

  • rrrrrr
    edited 6:04PM

    Hello sebastiaan,

    I succeeded to use OpenSeasame with Pygaze in MacOS!
    I needed to move the plugins ('pygaze_init', 'pygaze_log'...) to '/opensesame/plugins'.
    It doesn't work when I moved it to other plugins directories.

    Next, I try to use Pygaze in Expyriment script.
    How can I do that?
    Is it possible to add pygaze functions to my script of Expyriment, and copy it in the 'inline_script'?

    Best,

  • rrrrrr
    edited 6:04PM

    Hello,

    I was able to do the eye tracking!
    Pygaze functions (e.g., eyetracker....()) on 'inline_script' worked fine.

    Thank you very much for your kind advice.
    I hope this helps for all user of MacOS.

    Best,

  • edited 6:04PM

    Good to hear!

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games