esmall1894
New to this, Trying to install OpenPLC Editor on Raspberry Pi 3+, and getting this error on line 64:

"/home/pi/Documents/PLCopen Editor/PLCOpenEditor.py", line 64, in <module>
   if wx.VERSION >= (3, 0, 0):
NameError: name 'wx' is not defined

Any Ideas on how to resolve?
Reply 0 0
thiagoralves
Apparently you didn’t install the dependencies, did you?
Reply 0 0
esmall1894
I ran the dependency as shown on the Editor install page:

pi@raspberrypi:~ $ sudo apt-get install python-wxgtk3.0 pyro python-numpy python-nevow python-matplotlib python-lxml
Reading package lists... Done
Building dependency tree
Reading state information... Done
pyro is already the newest version (1:3.14-5).
python-lxml is already the newest version (3.7.1-1).
python-matplotlib is already the newest version (2.0.0+dfsg1-2).
python-numpy is already the newest version (1:1.12.1-3).
python-wxgtk3.0 is already the newest version (3.0.2.0+dfsg-4).
The following additional packages will be installed:
python-attr python-constantly python-incremental python-pam
python-pyasn1-modules python-service-identity python-twisted-bin
python-twisted-core python-zope.interface
Suggested packages:
python-attr-doc python-twisted-bin-dbg python-qt3
The following NEW packages will be installed:
python-attr python-constantly python-incremental python-nevow python-pam
python-pyasn1-modules python-service-identity python-twisted-bin
python-twisted-core python-zope.interface
0 upgraded, 10 newly installed, 0 to remove and 1 not upgraded.
Need to get 2,651 kB of archives.
After this operation, 16.8 MB of additional disk space will be used.

**Once finished, ran PLCOpenEditor.py, as listed.  Got this response:

pi@raspberrypi:~/Documents/PLCopen Editor $ python PLCOpenEditor.py
Traceback (most recent call last):
File "PLCOpenEditor.py", line 64, in <module>
if wx.VERSION >= (3, 0, 0):
NameError: name 'wx' is not defined
pi@raspberrypi:~/Documents/PLCopen Editor $ 

Any thoughts?
esmall1894


Reply 0 0
thiagoralves
Do you have any other python environment installed on your system? It seems that wxpython is installed but isn’t liked to your “python” shortcut. Try this:

python2 PLCOpenEditor.py

or

python3 PLCOpenEditor.py

and let me know if any of those work
Reply 0 0
skv
What is default python version in your system?
$ python --version
Python 2.7.15
Reply 0 0
Reply