Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named PySimpleGUI #3

Open
strk opened this issue Jul 12, 2024 · 7 comments
Open

ImportError: No module named PySimpleGUI #3

strk opened this issue Jul 12, 2024 · 7 comments

Comments

@strk
Copy link

strk commented Jul 12, 2024

It looks like the Install.sh script doesn't deal with installing dependencies as I get an error running birdland right after running ./Install.sh:

[strk@oli:/usr/local/src/music/Birdland(main)] birdland 
Traceback (most recent call last):
  File "/home/strk/.local/bin/birdland", line 25, in <module>
    import PySimpleGUI as sg
ModuleNotFoundError: No module named 'PySimpleGUI'

Unfortunately I cannot find a package if I search for PySimpleGUI in the apt cache ( apt cache search PySimpleGUI) so I'm stuck as to how to proceed. Ideas ? The recommended way of using pip is discouraged by Debian:

[strk@oli:/usr/local/src/music/Birdland(main)] pip install PySimpleGUI
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
@strk
Copy link
Author

strk commented Jul 12, 2024

I'm not a python expert but I've had some nice experience with pipx install <project>, how hard would it be to make it possible for birdland as well ?

@strk
Copy link
Author

strk commented Jul 12, 2024

I've seen that PySimpleGUI is not opensource software, which explains why it isn't in Debian. Would you consider replacing its use with something that allows to really use your project as free software ?

@wrwetzel
Copy link
Owner

Sandro,

First, an apology for not getting back to you quickly. I've been busy but that's not a good excuse.

Second, I haven't touched Birdland in a while and I know I left it in a state that was inconvenient to install. I hope to get back to it in the next few months depending on available mindshare.

Now, to your notes. It appears that PySimpleGUI is still available free for non-commercial use but there is a little friction in the process of acquiring it. See: https://www.pysimplegui.com/faq

There is now a free version, FreeSimpleGUI, from another developer who copied the last free release of PySimple
GUI, if I remember correctly. See: https://github.com/spyoungtech/FreeSimpleGUI

I had a quick go at trying it out but bumped up against an install problem with it and didn't put the time into resolving it.

I explored making Birdland installable with pip, plan to do so, but not immediately.

I'm afraid that Birdland is so dependent on PySimpleGUI that it would be hard to untangle it from that GUI. I specifically do not have a GUI abstraction layer that would make it easy to replace PySimpleGUI with another UI library. However, to your concern about "free software", I believe the FreeSimpleGUI will satisfy that need.

I think this about addresses your questions. Get back to me if not or you have more questions.
Bill

@wrwetzel
Copy link
Owner

wrwetzel commented Jul 18, 2024

Sandro,

I just downloaded a copy of FreeSimpleGUI from:

 https://github.com/spyoungtech/FreeSimpleGUI/blob/v5.1.0/FreeSimpleGUI/FreeSimpleGUI.py

copied it to the Birdland src folder, commented out the PySimpleGUI include and added:

 import FreeSimpleGUI as sg

and Birdland launched and appeared to run OK. This give you a path to at least explore Birdland.

Bill

@strk
Copy link
Author

strk commented Jul 19, 2024 via email

@wrwetzel
Copy link
Owner

Hmmm, I have no idea why popup() is not defined. I'll have to look into that and likely contact the FreeSimpleGUI developers.

"What about pushing your work in a branch so it's easier to test ?" - I'm afraid that I'm a complete beginner when it comes to git. I just learned enough to get this to github. I don't know what you mean by the question. Please explain or, better yet, tell me what to do.

I'll be glad to answer whatever questions you have but I won't have time for actual development work for a while. Several things in the queue ahead of Birdland.

Bill

@strk
Copy link
Author

strk commented Jul 21, 2024

How to push your work in a branch:

  1. Create the branch (we'll call it "freeSimpleGui"): git branch freeSimpleGui
  2. Switch to the newly created branch: git checkout freeSimpleGui
  3. Modify the files as you see needed
  4. Commit the changes: git commit -a
  5. Push the branch to the github repository and indicate it as its upstream (I'm assuming the github remote is called "origin"): git push --set-upstream origin freeSimpleGui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants