How to use PYNQ without Jupyter from the command line

Can you provide an example, how to use PYNQ without Jupyter from command line?
What steps I need to do to achieve this?

PYNQ needs Python 3.6+. Python 2.7 is also on the board as it is needed/part of the OS, and it is the default.
If you start “python” on the cmd line, it will be 2.7 and PYNQ won’t work. You just need to start python3, or put python3 at the top of your Python file.

If this is new to you, this page may be useful: how to run Python scripts
(I just did a quick google and picked the first result. I’m sure there are plenty of other resources for this.)

Cathal

2 Likes

Hi Cathal,

Thanks for your response.
I am aware of the needs of Python 3.6 and the fact that 2.7 is installed. Do I need to install anything else? What libraries do I need to import beyond the one that used in Jupyter?
I have an application running in Jupyter, I need to move it to the command prompt.

No, you don’t need anything else.

You can just download your notebook as a .py file. You will need to modify the first line:
#!/usr/bin/env python

#!/usr/bin/env python3

If you have code that will only run in a notebook (e.g. interactive plots or widgets) they won’t run on the command line.

Cathal

2 Likes