Joulescope software for JS220

When trying to run my new JS220 I ran into a problem building/installing software. When the requirements are installed (pip3 install -U -r requirements.txt) I get the following:

Collecting pyjoulescope_driver>=1.1.0
Using cached pyjoulescope_driver-1.1.0.tar.gz (2.6 MB)
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “/tmp/pip-install-4x5be8db/pyjoulescope-driver_4f496bc729f94be7823be9a94ec1a2e7/setup.py”, line 32, in
from pyjoulescope_driver.release import releases_get_from_network
File “/tmp/pip-install-4x5be8db/pyjoulescope-driver_4f496bc729f94be7823be9a94ec1a2e7/pyjoulescope_driver/release.py”, line 30, in
import requests
ModuleNotFoundError: No module named ‘requests’
[end of output]

I’m using python3.11 on Ubuntu 20.04.

Thanks,
Ben Beckwith

Hi @bbeck - Thanks for letting me know! The workaround for now is:

pip3 install -U requests

The pyjoulescope_driver setup.py has requests in setup_requires, so I am not sure what’s going on. I’ll investigate.

Thanks for your response. I ran into missing libudev.h (fixed by installint libudev-dev), but now I get this:

cc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude -Iinclude_prv -I/home/ben/venv/joulescope/lib/python3.11/site-packages/numpy/core/include -I/home/ben/venv/joulescope/include -I/usr/local/include/python3.11 -c pyjls/binding.c -o build/temp.linux-x86_64-cpython-311/pyjls/binding.o -msse4
In file included from /home/ben/venv/joulescope/lib/python3.11/site-packages/numpy/core/include/numpy/ndarraytypes.h:1948,
from /home/ben/venv/joulescope/lib/python3.11/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/ben/venv/joulescope/lib/python3.11/site-packages/numpy/core/include/numpy/arrayobject.h:5,
from pyjls/binding.c:728:
/home/ben/venv/joulescope/lib/python3.11/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
17 | #warning "Using deprecated NumPy API, disable it with " \
> ^~~~~~~
pyjls/binding.c: In function ‘__Pyx_PyBytes_Equals’:
pyjls/binding.c:33026:13: warning: ‘ob_shash’ is deprecated [-Wdeprecated-declarations]
33026 | hash1 = ((PyBytesObject*)s1)->ob_shash;
> ^~~~~
In file included from /usr/local/include/python3.11/bytesobject.h:62,
from /usr/local/include/python3.11/Python.h:50,
from pyjls/binding.c:44:
/usr/local/include/python3.11/cpython/bytesobject.h:7:35: note: declared here
7 | Py_DEPRECATED(3.11) Py_hash_t ob_shash;
> ^~~~~~~~
pyjls/binding.c:33027:13: warning: ‘ob_shash’ is deprecated [-Wdeprecated-declarations]
33027 | hash2 = ((PyBytesObject*)s2)->ob_shash;
> ^~~~~
In file included from /usr/local/include/python3.11/bytesobject.h:62,
from /usr/local/include/python3.11/Python.h:50,
from pyjls/binding.c:44:
/usr/local/include/python3.11/cpython/bytesobject.h:7:35: note: declared here
7 | Py_DEPRECATED(3.11) Py_hash_t ob_shash;
> ^~~~~~~~
pyjls/binding.c: In function ‘__Pyx_AddTraceback’:
pyjls/binding.c:476:62: error: dereferencing pointer to incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
476 | #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
> ^~
pyjls/binding.c:33853:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
33853 | __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pyjls

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: pip install --upgrade pip

Thanks,
Ben

So, apparently pip ignores setup_requires in setup.py. The answer is pyproject.toml as defined in PEP 518.

I am not sure what is up with that problem building pyjls. The deprecated numpy API is a known issue with Cython.

So what should I do?

Ok, it looks like Cython 0.29 is not compatible with Python 3.11. You will need Cython 3.x, which is still in beta. See here and here, and the Cython changelog. Note that our official support, Ubuntu 22.04 LTS, still runs Python 3.10.

Note that python 3.11.0 was released 24 October 2022, so it is still very new, and everyone is still catching up.

I recommend that you downgrade your system or virtual environment to python 3.10.

Matt,

Thanks, reverting to 3.10 fixed my ability to build from source.

Thanks,
Ben

1 Like