-
Notifications
You must be signed in to change notification settings - Fork 22
cerebus.cbpy
- Download a wheel from the releases page or build it yourself.
- Activate a Python environment with pip, Cython, and numpy
- Install the wheel:
pip install path\to\filename.whl
- Test with
python -c "from cerebus import cbpy; cbpy.open(parameter=cbpy.defaultConParams())"
- Make sure you are not in a folder with a subfolder named
cerebus
(i.e., the CereLink root) when you run this. - You might get
RuntimeError: -30, Instrument is offline.
. That's OK, depending on your device and network settings.
- Make sure you are not in a folder with a subfolder named
LINK : fatal error LNK1181: cannot open input file 'Qt6Core.lib'
You did not set the correct QTDIR.
python -c "from cerebus import cbpy"
ImportError: DLL load failed while importing cbpy: The specified module could not be found.
At runtime, the Qt libraries are also required. On Linux and Mac, it is usually sufficient to install Qt6 at the system level with apt or homebrew. In Windows, it should be sufficient to have Qt6Core.dll on the path somewhere, but I've found this to be unreliable depending on the Python environment manager. The most reliable approach is to copy Qt6Core.dll into the same folder as your .pyd file.
Get the location of your site packages folder: python -c "import site; print(site.getsitepackages())"
Copy the Qt6Core.dll (and possibly Qt6Xml.dll) from (e.g.) C:\Qt\6.5.2\msvc2019_64\bin
into site-packages-folder-from-previous-command\cerebus
.
Depending on how far you go back and what folders you look in, you might find an early CPython extension implementation that tried to match the MATLAB extensions format. This was never great, and should not be used. The cerebus
folder has the latest Python implementation with is a simple package using Cython.