Installing CW 5.1.1. on Ubuntu

Hi, I am trying to install CW 5.1.1 on Ubuntu 18.04 LTS. I downloaded and unzipped the CW 5.1.1 source code and ran setup.py. I also installed the drivers. Then, I ran ‘jupyter notebook’ inside the chipwhisperer/jupyter folder. Right on the first tutorial, when I tried to check the version of the arm-none-eabi-gcc, I get an error saying it can’t be found. But when I try it via a terminal, I can get a version.

It seems like jupyter notebook is running in a totally different environment! But I dont recall installing jupyter via conda or pip! Was it part of the zip file? Do I need to install files into some separate envinroment for jupyter to find them? I’m very new to Jupyter so help is much appreciated! thank you!

How did you install the Arm toolchain? Did you follow the note about Ubuntu here?

If you did everything right, what does “which arm-none-eabi-gcc” give you in a terminal?
Then, in any Jupyter notebook, add this cell:

%%bash
echo $PATH

What do you get?

Jean-Pierre

No, I actually used the instructions here. I guess these are old and I should use the link you gave me instead?

which arm-none-eabi-gcc in my terminal gives:
/usr/bin/arm-none-eabi-gcc

%%bash
echo $PATH (in jupyter notebook gives)
/snap/jupyter/6/bin:/snap/jupyter/6/usr/sbin:/snap/jupyter/6/usr/bin:/snap/jupyter/6/sbin:/snap/jupyter/6/bin:/home/karthik/snap/jupyter/common/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

I had another question. Could I run these commands outside the Jupyter notebook? or does it setup a special environment that CW needs to run.

thanks!

To your last question:
No, the commands you find in the tutorial can also be run outside of Jupyter in a Python script. You can convert a Jupyter notebook into a script by running:
$ jupyter nbconvert --to script <notebook.ipynb>

I’m puzzled why you can’t run the ARM compiler in Jupyter since it’s in your $PATH.
I’m unfamiliar with the “snap” installation of Jupyter that you seem to have, maybe that is where the problem lies… there are many ways to install Jupyter… in my case, I’ve installed it with pip on Ubuntu 18.10.

Did you follow these instructions from the CW installation notes:

Note
Some versions of Ubuntu (Ubuntu Bionic Beaver and likely before) provide a GNU Arm toolchain that links to incorrect files during the build process. To install a working version of the toolchain.

wget https://mirrors.kernel.org/ubuntu/pool/universe/n/newlib/libnewlib-dev_3.0.0.20180802-2_all.deb
wget https://mirrors.kernel.org/ubuntu/pool/universe/n/newlib/libnewlib-arm-none-eabi_3.0.0.20180802-2_all.deb
sudo dpkg -i libnewlib-arm-none-eabi_3.0.0.20180802-2_all.deb libnewlib-dev_3.0.0.20180802-2_all.deb

I don’t even recall installing jupyter using snap. I must have for something else and forgotten about it! So i just totally removed that to try installing it using pip. So I did a “snap remove jupyter” and make sure it counldn’t run from terminal anymore before proceeding.

I followed the instructions you provided and got all the prerequisites (python3 python3-pip etc) installed.

However, I hit errors when installing Jupyter. When executing “pip install -r jupyter/requirements.txt --user”, I got the following errors:

For nbparameterise:

Could not find a version that satisfies the requirement nbparameterise (from -r jupyter/requirements.txt (line 7)) (from versions: )
No matching distribution found for nbparameterise (from -r jupyter/requirements.txt (line 7))

For matplotlib==3.0.3

Could not find a version that satisfies the requirement matplotlib==3.0.3 (from -r jupyter/requirements.txt (line 3)) (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3, 2.2.4)
No matching distribution found for matplotlib==3.0.3 (from -r jupyter/requirements.txt (line 3))

And I am unable to run the next line “jupyter nbextension enable --py widgetsnbextension” as I get an error saying Jupyter is not found.

But I did check that chipwhisperer is installed from python using the import command.

Hmm, one possibility is that you’re trying to install for Python 2?
If pip --version says Python 2.7, then that’s the problem, and you’ll have to use pip3 explicitly instead of pip.

Jean-Pierre

Hi, yep that was it! the minute I did it using pip3 it worked perfectly. And I’m able to compile and download to the board via a jupyter notebook! many thanks for your help!