# Running pynq outside Jupyter Notebooks

**URL:** <https://discuss.pynq.io/t/running-pynq-outside-jupyter-notebooks/1671>\
**Category:** Support\
**Created:** [August 21, 2020, 12:11pm UTC](https://discuss.pynq.io/t/running-pynq-outside-jupyter-notebooks/1671 "2020-08-21T12:11:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ameetnsharma](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/ameetnsharma/32/1211_2.png) [@ameetnsharma](https://discuss.pynq.io/u/ameetnsharma)\
**Post date:** [August 21, 2020, 12:11pm UTC](https://discuss.pynq.io/t/running-pynq-outside-jupyter-notebooks/1671/1 "2020-08-21T12:11:43Z")

</div>

PYNQ Version  
Release 2019\_10\_03 3f63450  
(typing pip3 show pynq gives me version 2.5.4)

Board:  
PYNQ-Z2

Python3 version:  
3.6.5

The issue:  
I’m trying to run pynq outside of Jupyter Notebooks.

This is what I have in my hello2.py file:

from pynq import Overlay

That’s all.  
I try to run this program using python3 hello2.py

then I get these errors:

"Traceback (most recent call last):  
File “hello2.py”, line 1, in   
from pynq import Overlay  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/ **init**.py”, line 33, in   
from .pl import PL  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/pl.py”, line 39, in   
from .ps import CPU\_ARCH\_IS\_SUPPORTED, CPU\_ARCH, ZYNQ\_ARCH, ZU\_ARCH  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/ps.py”, line 322, in   
class \_ClocksUltrascale(\_ClocksMeta):  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/ps.py”, line 382, in \_ClocksUltrascale  
IOPLL\_CTRL = Register(CRL\_APB\_ADDRESS + IOPLL\_CTRL\_OFFSET)  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/registers.py”, line 115, in **init**  
array = MMIO(address, np.dtype(register\_type).itemsize).array  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/mmio.py”, line 82, in **init**  
device = Device.active\_device  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/pl\_server/device.py”, line 94, in active\_device  
if len(cls.devices) == 0:  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/pl\_server/device.py”, line 78, in devices  
cls.\_devices.extend(DeviceMeta.\_subclasses[key]._probe_())  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/pl\_server/device.py”, line 565, in _probe_  
return [XlnkDevice()]  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/pl\_server/device.py”, line 574, in **init**  
self.default\_memory = Xlnk()  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/xlnk.py”, line 133, in **init**  
raise RuntimeError(“Root permission needed by the library.”)  
RuntimeError: Root permission needed by the library.  
Exception ignored in: \<bound method Xlnk. **del** of \<pynq.xlnk.Xlnk object at 0xb573b1b0\>\>  
Traceback (most recent call last):  
File “/home/xilinx/.local/lib/python3.6/site-packages/pynq/xlnk.py”, line 150, in **del**  
for key in self.bufmap.keys():  
AttributeError: ‘Xlnk’ object has no attribute ‘bufmap’  
"  
This only happens outside Jupyter Notebooks. Would appreciate any help on how to run pynq outside Jupyter Notebooks. thanks.

UPDATE:

Ok. The error above occurs when I open a terminal through Putty. But when I open a terminal through Jupyter Books, everything works fine. Is there any way to get it to work through Putty also?

UPDATE 2:  
Ok. I found out that if I do: sudo python3 hello2.py it works. So the problem was a lack of root permission. So my question now is, how do I log in as root from Putty? If I put in ‘root’ as the username it asks for the password… ‘xilinx’ doesn’t work as the password for root.

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [August 24, 2020, 12:39pm UTC](https://discuss.pynq.io/t/running-pynq-outside-jupyter-notebooks/1671/2 "2020-08-24T12:39:04Z")

</div>

sudo  
su  
xilinx should work as the password.

Can you post a log?

Cathal

---

<div class="post-metadata">

**Author:** ![ameetnsharma](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/ameetnsharma/32/1211_2.png) [@ameetnsharma](https://discuss.pynq.io/u/ameetnsharma)\
**Post date:** [August 24, 2020, 1:09pm UTC](https://discuss.pynq.io/t/running-pynq-outside-jupyter-notebooks/1671/3 "2020-08-24T13:09:58Z")

</div>

That worked. Thanks.
