Error while installing labscript suite - Numpy array, DLL, etc

233 views
Skip to first unread message

Puzzle

unread,
Aug 22, 2024, 9:18:11 AM8/22/24
to the labscript suite
Hi,

I installed Labscript-suite, while opening  BLACS, Lyse, and runviewer getting the below error.


Traceback (most recent call last):
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\numpy\_core\__init__.py", line 23, in <module>
    from . import multiarray
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\numpy\_core\multiarray.py", line 10, in <module>
    from . import overrides
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\numpy\_core\overrides.py", line 8, in <module>
    from numpy._core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath: %1 is not a valid Win32 application.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\numpy\__init__.py", line 128, in <module>
    from numpy.__config__ import show as show_config
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\numpy\__config__.py", line 4, in <module>
    from numpy._core._multiarray_umath import (
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\numpy\_core\__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.11 from "C:\Users\Administrator\anaconda3\envs\lb\python.exe"
  * The NumPy version is: "2.1.0"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: DLL load failed while importing _multiarray_umath: %1 is not a valid Win32 application.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Administrator\labscript-suite\blacs\blacs\__main__.py", line 55, in <module>
    import labscript_utils.h5_lock, h5py
  File "C:\Users\Administrator\labscript-suite\labscript-utils\labscript_utils\h5_lock.py", line 37, in <module>
    import h5py
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\h5py\__init__.py", line 33, in <module>
    from . import version
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\h5py\version.py", line 17, in <module>
    import numpy
  File "C:\Users\Administrator\anaconda3\envs\lb\Lib\site-packages\numpy\__init__.py", line 133, in <module>
    raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
        its source directory; please exit the numpy source tree, and relaunch
        your python interpreter from there.



dihm....@gmail.com

unread,
Aug 22, 2024, 5:35:34 PM8/22/24
to the labscript suite
This is due to the (somewhat) recent transition of numpy from v1 to v2, which requires recompilation of all extensions that rely on numpy (ie our labscript-c-extensions package). We are working on getting that package updated so this isn't an issue, but in the meantime you can manually downgrade numpy to v1.xx and everything should work.

-David

Puzzle

unread,
Aug 23, 2024, 3:11:46 AM8/23/24
to the labscript suite
I downgraded Numpy version to 1.21, 1.26 but the error persist. I will try V1 again. Do I need to uninstall labscript-suite and reinstall again after changing python and numpy version.

Puzzle

unread,
Aug 23, 2024, 6:36:28 AM8/23/24
to the labscript suite
After reinstalling labscript-suite, and changing the apparatus name from .ini file, getting zmq error.

Traceback (most recent call last):
  File "C:\Users\Administrator\labscript-suite\blacs\blacs\__main__.py", line 756, in <module>
    experiment_server = ExperimentServer(port)
                        ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\labscript-suite\labscript-utils\labscript_utils\ls_zprocess.py", line 190, in __init__
    zprocess.ZMQServer.__init__(
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zprocess\clientserver.py", line 483, in __init__
    _ZMQServer.__init__(self, port, dtype=dtype, pull_only=pull_only,
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zprocess\clientserver.py", line 137, in __init__
    self.sock.bind('%s:%d' % (self.bind_address, self.port))
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zprocess\security.py", line 217, in bind
    return self._bind_or_connect(addr, bind=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zprocess\security.py", line 204, in _bind_or_connect
    result = method(self, addr)
             ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zmq\sugar\socket.py", line 311, in bind
    super().bind(addr)
  File "_zmq.py", line 917, in zmq.backend.cython._zmq.Socket.bind
  File "_zmq.py", line 179, in zmq.backend.cython._zmq._check_rc
zmq.error.ZMQError: No such device (addr='tcp://0.0.0.0:42517')

On Friday, August 23, 2024 at 3:05:34 AM UTC+5:30 dihm....@gmail.com wrote:

Puzzle

unread,
Aug 23, 2024, 7:03:30 AM8/23/24
to the labscript suite
The above zmq error appears while opening BLACS, runviewer, and lyse. While runmanager does not open.

On Friday, August 23, 2024 at 3:05:34 AM UTC+5:30 dihm....@gmail.com wrote:

David Meyer

unread,
Aug 23, 2024, 8:10:32 AM8/23/24
to labscri...@googlegroups.com
The plot thickens.

Can you post what version of zeromq/pyzmq/etc you have? Also, are you using a conda environment or a pip venv?

--
You received this message because you are subscribed to a topic in the Google Groups "the labscript suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/labscriptsuite/oQrn60APWoU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to labscriptsuit...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/labscriptsuite/1285e3f5-5cb5-4684-82d9-03cd6278889bn%40googlegroups.com.

Puzzle

unread,
Aug 26, 2024, 7:39:28 AM8/26/24
to the labscript suite

so, pyzmq version is 26.1.0 and I am using conda environment.

dihm....@gmail.com

unread,
Aug 26, 2024, 2:20:09 PM8/26/24
to the labscript suite
Hmm. It appears pyzmq=26.1.0 is only available via the conda-forge. You may be a little too far onto the bleeding edge. If possible, try having an installation that only uses the default and labscript-suite conda channels. Before re-installing, you could also try downgrading to pyzmq=25.1.2

-David

Puzzle

unread,
Aug 27, 2024, 10:23:50 AM8/27/24
to the labscript suite
I downgraded pyzmq to 25.1.0, reinstalled labscript suite again, with reinstallation it  after entering command

>>pip install --no-build-isolation --no-deps ^ -e labscript -e runmanager -e blacs -e lyse ^ -e runviewer -e labscript-devices -e labscript-utils
it installs latest versions of the packages.



===========================================================================================
Traceback (most recent call last):
  File "C:\Users\Administrator\labscript-suite\blacs\blacs\__main__.py", line 756, in <module>
    experiment_server = ExperimentServer(port)
                        ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\labscript-suite\labscript-utils\labscript_utils\ls_zprocess.py", line 190, in __init__
    zprocess.ZMQServer.__init__(
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zprocess\clientserver.py", line 483, in __init__
    _ZMQServer.__init__(self, port, dtype=dtype, pull_only=pull_only,
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zprocess\clientserver.py", line 137, in __init__
    self.sock.bind('%s:%d' % (self.bind_address, self.port))
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zprocess\security.py", line 217, in bind
    return self._bind_or_connect(addr, bind=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zprocess\security.py", line 204, in _bind_or_connect
    result = method(self, addr)
             ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\anaconda3\envs\py38\Lib\site-packages\zmq\sugar\socket.py", line 311, in bind
    super().bind(addr)
  File "_zmq.py", line 917, in zmq.backend.cython._zmq.Socket.bind
  File "_zmq.py", line 179, in zmq.backend.cython._zmq._check_rc
zmq.error.ZMQError: No such device (addr='tcp://0.0.0.0:42517')

=======================================================================================================

Philip Starkey

unread,
Aug 27, 2024, 11:06:20 AM8/27/24
to the labscript suite
could you try downgrading to pyzmq=23.2.0 and/or zeromq=4.3.4? We've had quite a few issues posted recently with pyzmq from Conda and these versions have generally solved the issues.

dihm....@gmail.com

unread,
Aug 30, 2024, 2:52:42 PM8/30/24
to the labscript suite
it installs latest versions of the packages.

That doesn't overly surprise me. You could try downgrading after installing everything fresh.

I haven't been able to reproduce yet (mostly lack of time). If you were comfortable doing so, could you post the output of `conda list` so I can try to reproduce fully?

Puzzle

unread,
Sep 4, 2024, 8:16:00 AM9/4/24
to the labscript suite
I am trying to add NI card, PCI 6374 and it does not have module on the site. I am trying to run get_capabilities.py but it is giving an error for PyDAQmnx, 

Traceback (most recent call last):
  File "c:\Users\Zeiss\labscript-suite\labscript-devices\labscript_devices\NI_DAQmx\models\get_capabilities.py", line 32, in <module>
    import PyDAQmx
ModuleNotFoundError: No module named 'PyDAQmx'


while I try to recompile BLACS, after manually entering capabilities it gives an error,


Recompiling connection table

C:\Users\Zeiss\Anaconda3\envs\myenv\lib\site-packages\runmanager\__init__.py:925: FutureWarning: get_shot_globals has moved to labscript_utils.shot_utils. Please update your code to import it from there.

warnings.warn(

Traceback (most recent call last):

File "C:\Users\Zeiss\labscript-suite\userlib\labscriptlib\MyFirstApparatus\connection_table.py", line 22, in <module>

from labscript_devices.NI_DAQmx.labscript_devices import NI_PCI_6374

ImportError: cannot import name 'NI_PCI_6374' from 'labscript_devices.NI_DAQmx.labscript_devices' (C:\Users\Zeiss\Anaconda3\envs\myenv\lib\site-packages\labscript_devices\NI_DAQmx\labscript_devices.py)

Compilation failed. Please fix the errors in the connection table (python file) and try again

Recompiling connection table

C:\Users\Zeiss\Anaconda3\envs\myenv\lib\site-packages\runmanager\__init__.py:925: FutureWarning: get_shot_globals has moved to labscript_utils.shot_utils. Please update your code to import it from there.

warnings.warn(

Traceback (most recent call last):

File "C:\Users\Zeiss\labscript-suite\userlib\labscriptlib\MyFirstApparatus\connection_table.py", line 22, in <module>

from labscript_devices.NI_DAQmx.models import NI_PCI_6374

File "C:\Users\Zeiss\Anaconda3\envs\myenv\lib\site-packages\labscript_devices\NI_DAQmx\models\NI_PCI_6374.py", line 4, in <module>

from labscript_devices.NI_DAQmx.models.NI_PCI_6374 import NI_DAQmx

ImportError: cannot import name 'NI_DAQmx' from partially initialized module 'labscript_devices.NI_DAQmx.models.NI_PCI_6374' (most likely due to a circular import) (C:\Users\Zeiss\Anaconda3\envs\myenv\lib\site-packages\labscript_devices\NI_DAQmx\models\NI_PCI_6374.py)

Puzzle

unread,
Sep 4, 2024, 8:18:14 AM9/4/24
to the labscript suite
(myenv) C:\Users\Zeiss\labscript-suite>pip list | findstr PyDAQmx
PyDAQmx                       1.4.6

dihm....@gmail.com

unread,
Sep 4, 2024, 5:18:34 PM9/4/24
to the labscript suite
Being unable to import pydaqmx in the get_capabilities script is an issue. Best guess is there is some annoying path issues to be sorted out in your environment. I assume you have activated your labscript environment before running that script.

As for the traceback, your import statement appears to be wrong in NI_PCI_6374.py. You need `from labscript_devices.NI_DAQmx.labscript_devices import NI_DAQmx`. Your code appears to be trying to import it from the same location as the file you are in (hence the circular import warning).

Message has been deleted

Amilson Fritsch

unread,
Sep 5, 2024, 11:20:21 AM9/5/24
to labscri...@googlegroups.com
At least in our installation, after running get_capabilities.py and generate_subclasses.py, the drivers for NI devices are created inside \labscript_devices\NI_DAQmx\models, so the way we import the NI DAQmx devices in the connection table is "from labscript_devices.NI_DAQmx.models import NI_PCI_6374". Pranwblaster and others are imported from the main labscript_devices folder using "from labscript_devices.PrawnBlaster.labscript_devices import PrawnBlaster"

Please check if this would work for you.

Best,
Amilson


On Thu, Sep 5, 2024 at 10:10 AM Puzzle <ankita...@gmail.com> wrote:
Now getting the below error after making some changes, was able to run get_capabilities, but it seems that the module had data I had entered manually, it just successfully ran on the terminal.  
You received this message because you are subscribed to the Google Groups "the labscript suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to labscriptsuit...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/labscriptsuite/0bf4a346-7799-4c5f-8efc-678143672465n%40googlegroups.com.

Puzzle

unread,
Sep 10, 2024, 9:20:12 AM9/10/24
to the labscript suite
I was able to generate module for NI PCIE 6374, however I am testing with only NI card, and the NI card is not detected  when used Dummyclock,  pseudoclock is visible instead. When I remove Dummyclock it shows an error as I have to remove parent device section too. 

The DummyIntermediatedevice module does not work. 



# Import some useful functions and packages
import numpy as np
from labscript import *

# Import the relevant devices from labscript_devices
#from labscript_devices.PrawnBlaster.labscript_devices import PrawnBlaster
#from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock
from labscript_devices.NI_DAQmx.models import NI_PCIe_6374






def ConnectionTable():

   # PrawnBlaster(
    #    name="prawnblaster_0",
    #    com_port="COM6",  # Change this to the right COM port on your computer
    #    num_pseudoclocks=2,
  #  )

   #   DummyPseudoclock(name='pseudoclock')

    NI_PCIe_6374(
        name="ni_card_1",
   #     parent_device=pseudoclock.clockline,
        clock_terminal="/Dev1/PFI0",
        MAX_name="Dev1",  # Change this to the name in NI MAX on your computer
    )

    # Create the output/input channels on the above devices use the example1 conversion
    # class located in pythonlib/unitconversions/example.py with default paremeters
    AnalogOut(
        name="analog0",
        parent_device=ni_card_1,
        connection="ao0",
    )
    AnalogOut(
        name="analog1",
        parent_device=ni_card_1,
        connection="ao1",
    )


if __name__ == '__main__':
    ConnectionTable()
    # Begin issuing labscript primitives
    # start() elicits the commencement of the shot
    start()
    # Stop the experiment shot with stop()
    stop(1.0)

Message has been deleted

Puzzle

unread,
Sep 10, 2024, 3:49:49 PM9/10/24
to the labscript suite

Recompiling connection table

Traceback (most recent call last):

File "C:\Users\Zeiss\labscript-suite\userlib\labscriptlib\MyApparatus\connection_table.py", line 47, in <module>

ConnectionTable()

File "C:\Users\Zeiss\labscript-suite\userlib\labscriptlib\MyApparatus\connection_table.py", line 25, in ConnectionTable

NI_PCIe_6374(

File "C:\Users\Zeiss\labscript-suite\labscript-devices\labscript_devices\NI_DAQmx\models\NI_PCIe_6374.py", line 61, in __init__

NI_DAQmx.__init__(self, *args, **combined_kwargs)

File "C:\Users\Zeiss\labscript-suite\labscript\labscript\utils.py", line 114, in new_function

return_value = func(inst, *args, **kwargs)

File "C:\Users\Zeiss\labscript-suite\labscript-devices\labscript_devices\NI_DAQmx\labscript_devices.py", line 204, in __init__

raise LabscriptError(dedent(msg))

labscript.utils.LabscriptError: Must specify a parent clockline, unless both static_AO and static_DO are True

Compilation failed. Please fix the errors in the connection table (python file) and try again



dihm....@gmail.com

unread,
Sep 10, 2024, 4:29:58 PM9/10/24
to the labscript suite
We are making progress!

The NI_DAQmx devices will require a clockline to instantiate correctly (unless they are static outputs only). The errors that occur when using the clocklines (dummy or prawnblaster) would be more helpful in debugging.

-David

Reply all
Reply to author
Forward
0 new messages