WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Pylink Import Error (https://forum.worldviz.com/showthread.php?t=4981)

chris2307 03-13-2014 11:45 AM

Pylink Import Error
 
Hi all,

I am using Vizard 5 32 bit and have attempted to import pylink in to my project file as follows:

sys.path.append("C:\WayfindingResearchCentre/pylink/pylink23")
print sys.path

I get this error:

ImportError: DLL load failed: The specified module could not be found.

In Vizard 4 42 bit, the pylink module is loaded in fine.

Does anyone know why this breaks in Vizard 5?

Thanks

chris2307 03-13-2014 07:38 PM

Sorry, I definitely copied the above code incorrectly. It should read:

Code:

sys.path.append("C:\WayfindingResearchCentre/pylink/pylink23")
import pylink


farshizzo 03-14-2014 05:04 PM

What version of pylink is installed in that directory? I installed the latest version of pylink through the Tools > Package Manager interface. After it installed I ran the following:
Code:

import pylink
And it imported successfully. Can you try installing the latest version?

chris2307 03-17-2014 05:13 AM

Okay,

So I guess it may have been installed incorrectly. The people who previously worked with pylink in Vizard 4 did not install it via the package manager but directly linked their project to the pylink directory (as I have tried to do above).

Installing pylink in the Vizard 5 beta means I can now import pylink. However, the previous code breaks and I now see this error.

Code:

Traceback (most recent call last):
  File "", line 11, in
  File "C:\Users\Operator\Desktop\Application\src\functions\EyeTracker.py", line 194, in
    beginExperiment()
  File "C:\Users\Operator\Desktop\Application\src\functions\EyeTracker.py", line 138, in beginExperiment
    _setupConnection(False)
  File "C:\Users\Operator\Desktop\Application\src\functions\EyeTracker.py", line 20, in _setupConnection
    eyelinktracker = pylink.EyeLink()    # Real connection
AttributeError: 'module' object has no attribute 'EyeLink'

The code at which it fails at is:

Code:

        if dummy == True:
                eyelinktracker = pylink.EyeLink(None) # open dummy connection
        else:
                eyelinktracker = pylink.EyeLink()    # Real connection

I'm getting frustrated now because I feel like I am missing something really obvious here...

farshizzo 03-17-2014 02:07 PM

I'm thinking the pylink module you are using is different than the official one that is hosted on the Python Package Index. Do you know where the previous module came from?

chris2307 03-18-2014 05:59 AM

The previous module came from the SR Research thread which contained links to the different platform specific pylink. I downloaded win32.

https://www.sr-support.com/showthread.php?14-Pylink

When importing manually, it works for Vizard4 but not at all for Vizard5. I have eliminated the possibility that it could be looking elsewhere by specifying the exact file path also.

I would prefer to install pylink using the package manager as this seems like the "proper" way to do things. FYI - When I did this, I downloaded Pylink 0.3.2 through the package manager interface. I saw no other versions available.

farshizzo 03-19-2014 11:09 AM

The pylink that is listed on the Python Package Index is completely unrelated to the pylink library provided by SR Research. I was able to get the pylink library provided by SR Research to work using the following steps:
  1. Download pylink_win32.zip from https://www.sr-support.com/showthread.php?14-Pylink
  2. Extract the zip file to your local computer
  3. Copy the entire pylink27 subfolder to the Vizard/bin/lib/site-packages folder
  4. Rename the pylink27 folder to pylink
  5. Now you can call import pylink from any Vizard script
I ran the above steps with Vizard 5 32-bit and it worked fine.

Note, as of the time of this post, SR Research does not seem to provide a 64-bit version of the pylink library for Windows, so this will not work with 64-bit versions of Vizard.

chris2307 03-19-2014 12:45 PM

Thank you for this.

I was completely unaware that there were two completely unrelated pylink librarys! :confused:

I will give this a go tomorrow when I am back in the office. Many thanks

chris2307 03-21-2014 04:07 AM

Just to confirm - This has worked so many thanks for your help.

I find it bizarre as I had attempted to manually link to all the sub-folders in pylink at one point or another! Must have been missing something rather obvious :/

Anyway, thank you for the help.


All times are GMT -7. The time now is 05:06 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC