Python issues | LabJack
 

Python issues

5 posts / 0 new
Last post
Monarr
Monarr's picture
Python issues

Hello,

I am trying to use Python with a T7 but am encountering the same issue described here: https://labjack.com/forums/t7/cannot-connect-t7-python-library. I ran:

from labjack import ljm
print(ljm.ljm._staticLib)

... as recommended by Labjack support in that thread, and it returned None. I am using Anaconda, and the LJM driver and Python, all downloaded and installed today so they are all up-to-date (I also tried reinstalling the driver and the LJM Python and am still running into the issue.)

As the user in the thread linked above said, any ideas on what is wrong? Thanks in advance.

LabJack Support
labjack support's picture
This issue is something to do

This issue is something to do with how the library is loaded. Please try exiting anaconda and/or your Python environment, then starting it back up. Does importing the ljm module throw an error? You should see an error message if there was an issue loading the library. We would only expect the "None" return from the print statement if you have a load issue, then subsequently try to print the library information.

What is the error message you receive when you try to run? What operating system and what version of Python are you using?

Monarr
Monarr's picture
Thank you for your quick

Thank you for your quick response - I am using Windows 10 64-bit and Anaconda 3.1. I restarted everything, and one of the example codes is now throwing the error "LJM library error code 1231 LJME_CANNOT_CONNECT". Specifically, I am trying to use the Stream Basic Python example code.

LabJack Support
labjack support's picture
We have our error codes and

We have our error codes and descriptions on this page:

https://labjack.com/support/software/api/ljm/error-codes

Your error code indicates that the library is now loading properly, but there is a device connection issue. Please close all software that could talk to the device (Kipling, LJLogM, etc.) and try to run the script again. Please also try power cycling the device and running the script again.


If none of the above helps, what connection type are you using? Can you open the device with the same connection parameters in Kipling?

Monarr
Monarr's picture
Power cycling the device

Power cycling the device worked, the code is now running fine. Thank you!