Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
1641 Discussions

Error running Jobs on Jupyter Notebook

Chawa__Elcid
Beginner
1,500 Views

Hello, I keep getting the following error when I try to run any job from my Jupyter Notebook in the DevCloud
 

Unable to init server: Could not connect: Connection refused

(frame:3558): Gtk-WARNING **: 23:43:02.292: cannot open display: 
Traceback (most recent call last):
  File "/etc/collectd/influxdbSender.py", line 580, in <module>
    sys.exit(main() or 0)
  File "/etc/collectd/influxdbSender.py", line 466, in main
    "applicationName": applicationName,
UnboundLocalError: local variable 'applicationName' referenced before assignment

0 Kudos
4 Replies
Chawa__Elcid
Beginner
1,500 Views

This error occurs when I use the cv2.imshow function on the Jupyter Notebook. Please can anyone help me with this issue.

0 Kudos
Priyanka_B_Intel1
1,500 Views

Hi Elcid,

Please refer to following article to solve the jupyter notebook and cv2.imshow issue: 

https://medium.com/@mrdatainsight/how-to-use-opencv-imshow-in-a-jupyter-notebook-quick-tip-ce83fa32b5ad  ;

 

Thanks,

Priyanka

0 Kudos
Jason_D_Intel
Employee
1,500 Views

Hello Elcid,

The following error message:

Traceback (most recent call last):
  File "/etc/collectd/influxdbSender.py", line 580, in <module>
    sys.exit(main() or 0)
  File "/etc/collectd/influxdbSender.py", line 466, in main
    "applicationName": applicationName,
UnboundLocalError: local variable 'applicationName' referenced before assignment

... should now be fixed. We think this error was harmless, and likely unrelated to the cv2.imshow issue, but if this error message persists, please let us know and we'll investigate.

Thanks,
Jason

0 Kudos
harvyjackk
Beginner
1,500 Views

Python has lexical scoping by default, which means that although an enclosed scope can access values in its enclosing scope, it cannot modify them (unless they're declared global with the global keyword). A closure binds values in the enclosing environment to names in the local environment. The local environment can then use the bound value, and even reassign that name to something else, but it can't modify the binding in the enclosing environment. UnboundLocalError happend because when python sees an assignment inside a function then it considers that variable as local variable and will not fetch its value from enclosing or global scope when we execute the function. To modify a global variable inside a function, you must use the global keyword.

 

0 Kudos
Reply