Hello I try to use Adalm 1000 with simple python command under Linux ubuntu 18.04 I follow python tutorial: https://wiki.analog.com/university/tools/python-tutorial/table-of-contents I try to found the required files : pysmu.py and libpysmu.so :no more available, not found in : https://github.com/analogdevicesinc/libsmu I follow libsmu installation and building in previous link. No error. I start simple example found here: https://wiki.analog.com/_media/university/tools/python-tutorial/alm1000_tutorial.zip <python blink_led.py session = Session(ignore_dataflow=True, queue_size=10000) NameError: name 'Session' is not definedlsusb and dmesg show adalm1000 module I miss something in libsmu installation. Link? Path? usr?? Thanks for help
I'm not a Linux user. It sounds like you are following the right steps. Maybe one of the libsmu support people who work on the linux side can help.
Everything works fine on Windows (using the libsmu Windows installer) for me.
Did you build and install the libsmu library as documented in the libsmu readme? https://github.com/analogdevicesinc/libsmu/blob/master/README.md
-Travis
Hello travis, Yes I do exactly this:
sudo apt-get install python-setuptools python-pipsudo pip install cythongit clone https://github.com/analogdevicesinc/libsmu.gitcd libsmumkdir build && cd buildcmake -DBUILD_PYTHON=ON .. ( fo binding python)makesudo ldconfigsudo udevadm control --reload-rulesexport PYTHONPATH=/usr/lib/python2.7/site-packages:${PYTHONPATH}I don't see any error during make, cmake, installation <locate pysmu results:
sudo apt-get install python-setuptools python-pip
sudo pip install cython
git clone https://github.com/analogdevicesinc/libsmu.git
mkdir build && cd build
cmake -DBUILD_PYTHON=ON .. ( fo binding python)
sudo udevadm control --reload-rules
export PYTHONPATH=/usr/lib/python2.7/site-packages:${PYTHONPATH}
/usr/bin/pysmu /usr/lib/python2.7/site-packages/pysmu /usr/lib/python2.7/site-packages/pysmu-1.0.0-py2.7.egg-info /usr/lib/python2.7/site-packages/pysmu/__init__.py /usr/lib/python2.7/site-packages/pysmu/__init__.pyc /usr/lib/python2.7/site-packages/pysmu/_vendor /usr/lib/python2.7/site-packages/pysmu/exceptions.py /usr/lib/python2.7/site-packages/pysmu/exceptions.pyc /usr/lib/python2.7/site-packages/pysmu/libsmu.so /usr/lib/python2.7/site-packages/pysmu/utils.py /usr/lib/python2.7/site-packages/pysmu/utils.pyc /usr/lib/python2.7/site-packages/pysmu/_vendor/__init__.py/usr/lib/python2.7/site-packages/pysmu/_vendor/__init__.pyc /usr/lib/python2.7/site-packages/pysmu/_vendor/enum.py /usr/lib/python2.7/site-packages/pysmu/_vendor/enum.pyc /usr/lib/python2.7/site-packages/pysmu-1.0.0-py2.7.egg-info/PKG-INFO /usr/lib/python2.7/site-packages/pysmu-1.0.0-py2.7.egg-info/SOURCES.txt /usr/lib/python2.7/site-packages/pysmu-1.0.0-py2.7.egg-info/dependency_links.txt /usr/lib/python2.7/site-packages/pysmu-1.0.0-py2.7.egg-info/top_level.txt
<python blink_led.py : same error : Traceback (most recent call last): File "blink_led.py", line 39, in <module> session = Session(ignore_dataflow=True, queue_size=10000) NameError: name 'Session' is not defined This demo board works under windows after the two exe files : libsmu and Gui installation
Any suggestion?
Regards.
Hello, It looks like the import from pysmu didn't work as expected. Could you try 2 scenarios and let us know the results?1) At the beginning of your python script, write "from pysmu import Session" and try again.2) At the beginning of your python script write "import pysmu" and modify the script like this:
session = pysmu.Session(ignore_dataflow=True, queue_size=10000)
Thank you, -Alexandra
Hello 1/ I add the line : from pysmu import Session Result after python blink.led: ...from pysmu import Session ImportError: cannot import name Session 2/ I suppress previous line and replace with: session = pysmu.Session(ignore_dataflow=True, queue_size=10000) error message : session = pysmu.Session(ignore_dataflow=True, queue_size=10000) AttributeError: 'module' object has no attribute 'Session'There is an issue with the section part of pysmu module.Regards
Hi, We still can't reproduce the issue. Let us investigate further and we will come back with more info as soon as possible.Can you run "python --version" to check what Python version are you using? (2.7 or 3.7)Can you run the "smu" utility? Does that work fine for you? You can open a terminal an write "smu" or "smu -l" and post the output here.
Thank you. -Alexandra
Hello Alexandra,
smu -l
<ADALM1000: serial 2031205051485435313330303530323 : fw 2.16 : hw F
python --version
<Python 2.7.15+
Maybe python version is to old. I try also with python3:
python3 --version
<Python 3.6.8
Thus I try again Led example: I need to change Tkinter :” from tkinter import *”
python3 blink_led.py..error with pysmu.py file :
In Python 3.x, the urlretrieve function is located in the urllib.request module:
urlretrieve
urllib.request
and urlib2 is no more available. I replace ‘’import urllib2’’ with “from urllib.request import urlopen”
Try again : error in blink_led.py:
File "blink_led.py", line 39, in <module>
session = Session(ignore_dataflow=True, queue_size=10000)
NameError: name 'Session' is not defined
Regards
Hello
Do you think this board is usable under Python 3.X ?
Hi,We still could not reproduce a scenario like this.Can you run: "locate libsmu.so " and send us the output?Might be that some of the library files or library dependencies are not properly installed.Did you have another version of libsmu installed before this one? -Alexandra
HEllo
It is the first time I install libsmu. Build in my home. I install some tools for adalm pluto sdr.
Here is the command result:
/home/remi/libsmu/bindings/python/build/lib.linux-x86_64-2.7/pysmu/libsmu.so/home/remi/libsmu/build/src/libsmu.so/home/remi/libsmu/build/src/libsmu.so.1/home/remi/libsmu/build/src/libsmu.so.1.0.1/usr/lib/libsmu.so/usr/lib/libsmu.so.1/usr/lib/libsmu.so.1.0.1/usr/lib/python2.7/site-packages/pysmu/libsmu.so
Hello,
May be my 21 oct answer is not in the right place here. Do you think we can work with this board under Python3 ?
Hi,You need to rebuild libsmu in order to build/link it against Python3.Also, we need to force CMake to check Python3 instead of Python2. The instructions are the following (Please modify them to use your exact paths to the Python3 version you have installed. This example uses 3.6)
sudo apt-get install python3-setuptools python3-pipsudo pip3 install cythoncd libsmumkdir build_py3 && cd build_py3
sudo apt-get install python3-setuptools python3-pip
sudo pip3 install cython
mkdir build_py3 && cd build_py3
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so ..
makesudo make install
sudo make install
export PYTHONPATH=/usr/lib/python3.6/site-packages:${PYTHONPATH}
-Alexandra