PySimpleGUI icon indicating copy to clipboard operation
PySimpleGUI copied to clipboard

[Question] Import error

Open userbisoogo opened this issue 1 year ago • 3 comments

Type of Issue (Enhancement, Error, Bug, Question)

Error


Operating System

macOs Sonoma 14.1

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Version information can be obtained by calling sg.main_get_debug_data() Or you can print each version shown in ()

Python version (sg.sys.version)

PySimpleGUI Version (sg.__version__)

5.0

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

tkinter


Your Experience In Months or Years (optional)

3 months Years Python programming experience

Years Programming experience overall 30 Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine) yes Anything else you think would be helpful?


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • [x] Searched main docs for your problem PySimpleGUI Documenation
  • [ ] Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demo Programs
  • [x] None of your GUI code was generated by an AI algorithm like GPT
  • [ ] If not tkinter - looked for Demo Programs for specific port
  • [ ] For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • [x] Run your program outside of your debugger (from a command line)
  • [ ] Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.com
  • [ ] Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • [ ] Tried running the Development Build. Your problem may have already been fixed but not released. Check Home Window for release notes and upgrading capability
  • [ ] For licensing questions please email [email protected]

Detailed Description

Code To Duplicate

A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)

This pre-formatted code block is all set for you to paste in your bit of code:


# Paste your code here


Screenshot, Sketch, or Drawing


Watcha Makin?

If you care to share something about your project, it would be awesome to hear what you're building.

userbisoogo avatar Apr 13 '24 09:04 userbisoogo

import os os.environ['PySimpleGui_license'] = '1712995095' import PySimpleGUI as sg

gives the error:

ModuleNotFoundError: No module named 'PySimpleGUI' on VS Code Editor and PyCharm.

userbisoogo avatar Apr 13 '24 09:04 userbisoogo

Please send licensing questions via email to [email protected]

It appears you're trying to specify the key as if it were a Distribution key. If you're trying to use your normal key ( a Developer Key), then that needs to be input into the Home Window. You'll find more info in the documentation: https://docs.pysimplegui.com/en/latest/documentation/installing_licensing/license_keys/

And in the FAQ: https://docs.pysimplegui.com/en/latest/FAQ/#how-do-i-install-my-license-keys-into-the-pysimplegui-software

This sounds more like an install problem, not a license key problem. Did you pip install within PyCharm/VS Code? Have you pip installed other modules successfully? Does your program run outside of an IDE from the command line?

PySimpleGUI avatar Apr 13 '24 13:04 PySimpleGUI

How did you install PySimpleGUI? You should be able to import the module without getting a "not found" error regardless of licensing or PySimpleGUI version. Sounds like you may be running a virtual environment in your IDEs and need to install from within VSCode and PyCharm.

PySimpleGUI avatar Apr 22 '24 17:04 PySimpleGUI