Problem getting opmrun to run
joakim-hove opened this issue · comments
bash% python omprun.py
OPMRUN Cannot Import PySimpleGUI - Please Install Using pip3
bash%pip3 install PySimpleGUIpip3 install PySimpleGUI
Collecting PySimpleGUI
Downloading https://files.pythonhosted.org/packages/b1/43/ea5d29f303241c6308b0dc7d684aab90763a7e01d011f1ec819da9ca94d0/PySimpleGUI-4.19.0-py3-none-any.whl (333kB)
|████████████████████████████████| 337kB 4.7MB/s
Installing collected packages: PySimpleGUI
Successfully installed PySimpleGUI-4.19.0
bash% python omprun.py
OPMRUN Cannot Import PySimpleGUI - Please Install Using pip3
Will take a look at this now, what distro are you using and what version
of Python?
I have Python 3.7.3 on Debian 10.4
Okay the issue is that the install went to a location that was not
picked up by the check. So for a workaround uninstall the package and
then re-install with:python3 -m pip install --user ||*package*||'
This sound very weird to me; if you use pip install package
and then just import package
it should work - no need to specify --user
install - that is a symptom of something else which is wrong - sorry.
I am sorry - but this:
for package in required:
try:
dist = pkg_resources.get_distribution(package)
if package == 'PySimpleGUI':
sg = importlib.import_module(package)
if package == 'pandas':
pd = importlib.import_module(package)
is the wrong approach. The importlib
package is a low level package implementing the import
statement; it is exposed in the standard library to facilitate specialized import functionality - not for run of the mill imports like you have here.
I don't know the details - but I am skeptical to the PySimpleGUI
package, that seems to be a frontend to at least three different gui backends - namely Tk
, Qt
and Wx
- to me that seems to be a fragile high maintenance solution. I do not have Qt
or Wx
installed - i.e. I guess PySimpleGUI
falls back to Tk
in my case - which gui backend do you use?
I face the same issue in running OPMRUN in Ubuntu 20.04 . I'm using the default installation of Python in Ubuntu.
Well it does work for Ubuntu 20.04 in my VM, so without further information it is difficult to see why it is not working for you.
Have you installed tkinter? On Linux based systems install tkinter via the package manager. Debian versions of Linux you have to install it manually by using the following command: sudo apt-get install python3-tk
The PR checks for this and issues the above message, but the PR has not been accepted in the master. I'll send you my version of OPMRUN as a zip file to your email address.
Let me know how you get one.
Closing as complete.