Jupyter problems

Just about everything about Red Pitaya
Post Reply
dangraf
Posts: 9
Joined: Thu Feb 25, 2016 1:09 pm

Jupyter problems

Post by dangraf » Thu Mar 30, 2017 12:36 pm

Hello!
I tried to open the jupyter server app on my red-pitaya. But it does not work as I was expecing.
1. I can't open the examples. It seems like the notebook are looking in the /home/jupyter... folders and examples are missing. I have cloned the git-repository (as explained in the getting started tutorial) and those examples seem to exist. Shoudn't these file exist?
2. I can't run the code. When I eg try to run the cell

Code: Select all

import shutil
shutil.copytree("/opt/redpitaya/jupyter/examples", "examples")
import os
os.system("/bin/chmod -x examples/*")
i just get error messages:

Code: Select all

FileExistsError                           Traceback (most recent call last)
<ipython-input-2-0ed0b1fcc284> in <module>()
      1 import shutil
----> 2 shutil.copytree("/opt/redpitaya/jupyter/examples", "examples")
      3 import os
      4 os.system("/bin/chmod -x examples/*")

/usr/lib/python3.5/shutil.py in copytree(src, dst, symlinks, ignore, copy_function, ignore_dangling_symlinks)
    307         ignored_names = set()
    308 
--> 309     os.makedirs(dst)
    310     errors = []
    311     for name in names:

/usr/lib/python3.5/os.py in makedirs(name, mode, exist_ok)
    239             return
    240     try:
--> 241         mkdir(name, mode)
    242     except OSError:
    243         # Cannot rely on checking for EEXIST, since the operating system

FileExistsError: [Errno 17] File exists: 'examples'
I'm not able to run any of the examples either. Why do I get these errors?
3. In the examples. they seem to use the module named "redpitaya". which is not found in my anaconda-install. I try to search for this module and it can't be found as an existing conda-package.
How do i get this python module?
4. I don't understand how the code should work. Should the python code be run on the red-pitaya sending information to my browser window? Or should The python code be running on my PC and fetch information from the red-pitaya?

izi
Posts: 34
Joined: Wed May 27, 2015 11:49 am

Re: Jupyter problems

Post by izi » Thu Mar 30, 2017 12:59 pm

Starting from a clean SD card install:
1. open the Jupyter app
2. open the welcome.ipynb notebook (it is there without the need to clone our repo from GitHub)
3. running the code in the notebook (it will copy examples from the read only FAT partition to the EXT4 partition)
3. run an example

The redpitaya module is not actually installed, it is just a python file in the same directory. We plan to install it properly in a later release, so it will be available from any directory.

I think Jupyter should be the main environment choice for most third party developers, since it is easy to use and easy for me to test new FPGA code. I was thinking about making a spinoff repository just containing the Jupyter code, and placing the repo inside /home/jupyter instead of the current setup, where code is copied from the FAT partition. But I am not sure yet, what do you think.

Regards,
Iztok Jeras
Red Pitaya

dangraf
Posts: 9
Joined: Thu Feb 25, 2016 1:09 pm

Re: Jupyter problems

Post by dangraf » Thu Mar 30, 2017 9:30 pm

Yes. but i just made a fresh install today with latest stable release because of other problems.
The welcome.ipynb is automatically opened when running jupyter app. and works. But i get the 404 error when clicking on the examples in the welcome.ipynb
And i'm not able to run the code in the cells.

I like the idea to have all code in one place like you describe. But usually i have my own repo somewhere with code that i want to use and the red-pitaya code somewere else. So i was just thinking of adding extra paths to the jupyter notebook by adding the
import sys
sys.path.append("../")
to add the directories with modules to use
But i haven't used jupyter that much so maybe i'm not the correct person to answer this question :-)
Edit: name of the image is "redpitaya_ubuntu_15-04-44_23-feb-2017.img"

izi
Posts: 34
Joined: Wed May 27, 2015 11:49 am

Re: Jupyter problems

Post by izi » Fri Mar 31, 2017 6:37 pm

404 is usually due to a link pointing to a non existing page
could you give me the exact URL please, so I can try the image again

Regarding the module path, as I mentioned, I currently plan to create a separate Jupyter repo
and instead of adding a module path, I plan to install the package with --editable,
which will enable updating drivers with 'git pull' without performing another install
https://pip.pypa.io/en/stable/reference ... mdoption-e

dangraf
Posts: 9
Joined: Thu Feb 25, 2016 1:09 pm

Re: Jupyter problems

Post by dangraf » Fri Mar 31, 2017 6:49 pm

Thanks. I will give you the url when i'm back at work at Monday. Thanks for your support!

dangraf
Posts: 9
Joined: Thu Feb 25, 2016 1:09 pm

Re: Jupyter problems

Post by dangraf » Mon Apr 03, 2017 12:43 pm

It is working now! sorry for this. I was too quick creating the "examples" directory my self after a fresh install and got a lot of errors because of that. After removing it, i'm now able to run the code in the welcome notebook and everything is working as expected. My bad.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 30 guests