jl0311
Wondering if anyone has run into these issues. I am new to this software and recently followed the docs on the openplc website. Installed all dependencies and get different errors depending on the version of python I try to run with. Any pointers would be appreciated, using the PLCopen Editor v1.3 - Linux.zip on Debian 9 (Stretch) 4.9.0-8-amd64

##Python 2.7.15
user@wstn:~/Downloads/PLCopen Editor$ python2 PLCOpenEditor.py
Traceback (most recent call last):
File "PLCOpenEditor.py", line 33, in <module>
import wx
File "/home/user/anaconda2/lib/python2.7/site-packages/wx/__init__.py", line 17, in <module>
from wx.core import *
File "/home/user/anaconda2/lib/python2.7/site-packages/wx/core.py", line 12, in <module>
from ._core import *
ImportError: /home/user/anaconda2/bin/../lib/libpangoft2-1.0.so.0: undefined symbol: pango_font_description_set_variations

##Python 3.6.7
user@wstn:~/Downloads/PLCopen Editor$ python PLCOpenEditor.py
Traceback (most recent call last):
File "PLCOpenEditor.py", line 35, in <module>
import version
File "/home/user/Downloads/PLCopen Editor/version.py", line 181, in <module>
rev = GetAppRevision()
File "/home/user/Downloads/PLCopen Editor/version.py", line 50, in GetAppRevision
app_dir = paths.AbsDir(__file__)
File "/home/user/Downloads/PLCopen Editor/util/paths.py", line 38, in AbsDir
file = AbsFile(file)
File "/home/user/Downloads/PLCopen Editor/util/paths.py", line 33, in AbsFile
file = unicode(file, sys.getfilesystemencoding())
NameError: name 'unicode' is not defined
Quote 0 0
thiagoralves
PLCOpen Editor should run on Python 2.7. I don’t think it will work on Python 3.x. On the 2.7 environment, it seems that your wxwidgets (wxgtk) is either a bad version or it is not properly installed. What version of wxgtk did you install on Python 2.7 environment?
Quote 0 0
jl0311
Thanks for the reply thiagoralves. I am currently using the most recent version in the stable repositories:

python-wxgtk3.0 is already the newest version (3.0.2.0+dfsg-4).
Quote 0 0
jl0311
It appears you are correct sir. Using command pip2 install wxPython installs wxPython-4.0.4 but errors when I try and import exactly the same as when trying to run the editor:

user@wstn:~/Downloads$ pip2 install -U wxPython
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting wxPython
Requirement already satisfied, skipping upgrade: six in /home/user/anaconda2/lib/python2.7/site-packages (from wxPython) (1.11.0)
Requirement already satisfied, skipping upgrade: Pillow in /home/user/anaconda2/lib/python2.7/site-packages (from wxPython) (5.1.0)
Installing collected packages: wxPython
Successfully installed wxPython-4.0.4
user@wstn:~/Downloads$ python2

user@wstn:~/Downloads$ python2
Python 2.7.15 |Anaconda, Inc.| (default, May 1 2018, 23:32:55)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/anaconda2/lib/python2.7/site-packages/wx/__init__.py", line 17, in <module>
from wx.core import *
File "/home/user/anaconda2/lib/python2.7/site-packages/wx/core.py", line 12, in <module>
from ._core import *
ImportError: /home/user/anaconda2/bin/../lib/libpangoft2-1.0.so.0: undefined symbol: pango_font_description_set_variations
>>>
Quote 0 0
Mk1G
I am having similar problems with Linux version 1.3 of PLCOpenEditor on Ubuntu 18.04.
When trying to run PLCOpenEditor, I get:
Traceback (most recent call last):
File "./PLCOpenEditor.py", line 40, in <module>
from IDEFrame import IDEFrame, AppendMenu
File "/home/mark/Software/PLC/PLCopenEditor/IDEFrame.py", line 35, in <module>
from editors.EditorPanel import EditorPanel
File "/home/mark/Software/PLC/PLCopenEditor/editors/EditorPanel.py", line 29, in <module>
from controls import VariablePanel
File "/home/mark/Software/PLC/PLCopenEditor/controls/__init__.py", line 29, in <module>
from controls.CustomEditableListBox import CustomEditableListBox
File "/home/mark/Software/PLC/PLCopenEditor/controls/CustomEditableListBox.py", line 31, in <module>
class CustomEditableListBox(wx.gizmos.EditableListBox):
AttributeError: 'module' object has no attribute 'EditableListBox'

I'm not familiar with wxPython, but apparently wxPython 4.0 was the first release of the 'Phoenix' version. Previous versions are 'Classical'.
When I put:
>>> import wx
>>> print(wx.version())
4.0.4 gtk3 (phoenix) wxWidgets 3.0.5

According to the table at the bottom of this page:  https://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html:
  • In Classical, the 'EditableListBox' is part of wx.gizmos (referenced in the above code)
  • In Phoenix, the 'EditableListBox' is part of wx.adv

Also wx.gizmos seems depricated ( from this page:  https://wxpython.org/Phoenix/docs/html/MigrationGuide.html  
"Please migrate your code to use wx.lib.gizmos as wx.gizmos will likely go away in a future release." )

Can anyone advise which wx versions do work for the 1.3 release of PLCOpenEditor? Is there a better workaround? Or is it just me?
Thanks.
Quote 0 0
thiagoralves
You should use python-wxgtk3.0 instead of 4.0.
Quote 0 0
Mk1G
Thanks for coming back so quickly, thiagoralves.

I am using Ubuntu 18.04, which gives me:
  • python-wxgtk3.0
  • wxPython version 4.0.4 (which is 'phoenix')
  • which is built on wxWidgets 3.0.5

> sudo apt-cache policy python-wxgtk3.0
python-wxgtk3.0:
Installed: 3.0.2.0+dfsg-7
Candidate: 3.0.2.0+dfsg-7
Version table:
*** 3.0.2.0+dfsg-7 500
500 http://gb.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
100 /var/lib/dpkg/status

> sudo apt-cache policy python-wxgtk4.0
python-wxgtk4.0:
Installed: (none)
Candidate: 4.0.1+dfsg-2
Version table:
4.0.1+dfsg-2 500
500 http://gb.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

and of course:
>>> import wx
>>> print(wx.version())
4.0.4 gtk3 (phoenix) wxWidgets 3.0.5
Quote 0 0
thiagoralves
Hmm...it seems that python-wxgtk3.0 is bringing a newer version of wx. Try using python-wxgtk2.8 as per instructions here:  https://openplc.discussion.community/post/open-plc-editor-9298979?highlight=wxgtk2+8&pid=1303580430
Quote 0 0
thiagoralves
Are you sure you're not using your Python3 environment? I just downloaded Ubuntu 18.04 and installed it on a new virtual machine. After following the exact steps on the website to install the required packages (i.e. sudo apt-get install python-wxgtk3.0 pyro python-numpy python-nevow python-matplotlib python-lxml python-zeroconf) I got the following:

> sudo apt-cache policy python-wxgtk3.0
python-wxgtk3.0:
  Installed: 3.0.2.0+dfsg-7
  Candidate: 3.0.2.0+dfsg-7
  Version table:
 *** 3.0.2.0+dfsg-7 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status


> sudo apt-cache policy python-wxgtk4.0
python-wxgtk4.0:
Installed: (none)
Candidate: 4.0.1+dfsg-2
Version table:
4.0.1+dfsg-2 500
500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages


> python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> print(wx.version())
3.0.2.0 gtk3 (classic)


> python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> print(wx.version())
4.0.4 gtk3 (phoenix) wxWidgets 3.0.5


As you can see, my python3 environment is using wx phoenix, while the python2 environment is using wx classic. Try forcing the usage of your python2 environment by using python2 PLCOpenEditor.py.
Quote 0 0
Mk1G
thiagoralves - firstly - thank you for going to all that effort! Really appreciate it. As I say - I'm new to wxWidgets / wxGTK / wxPython, and not familiar with all the breaking changes between the various versions.
Great to know that the problem is I'm trying to use wxPython 4 (phoenix) and PLCOpenEditor needs wxPython 3 (classic).

I've pushed a lot of updates through in getting various python-based software running, so now both my Python2 and Python3 are using wxPython 4 (phoenix). 
I will restore wxPython 3 (classic) in my python2.7 environment. If that breaks anything else, I'll look at containers to separate out the various versions.
And I'll post the results here in case it helps anyone else.

Thanks again for all of your help.
Quote 0 0
Mk1G

Simpler than I thought!

My instance of python 2.7 was using wxPython 4 (phoenix). I could verify this by:
> python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> print(wx.version())
4.0.4 gtk3 (phoenix) wxWidgets 3.0.5

This is because I had previously installed wxPython 4 using pip (installing using 'pip' will install to Python 2.x. Installing using 'pip3' will install to Python 3.x).
It seems that 'pip' is only for the new wxPython (i.e. wxPython 4 - phoenix).
So ran the pip uninstaller:
> sudo pip uninstall wxPython

This removed wxPython 4 (phoenix).
However, wxPython 3 (classic) was still present on my system. It was not affected by the pip uninstall, and Python 2.x picked it up as soon as I had removed wxPython 4.
To verify that Python 2.x could still find the older version of wxPython:
> python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> print(wx.version())
3.0.2.0 gtk3 (classic)

After that - PLCOpenEditor ran perfectly!

Thanks for all of your help.
 

Quote 0 0
thiagoralves
I'm glad it worked! =)
Quote 0 0