Why does having a matching .py file on my PYTHONPATH cause gui_scripts to do nothing? #3694
-
I use the gui_scripts entry points heavily in PySimpleGUI. My setup.py has this section: entry_points={
'gui_scripts': [
'psgissue=PySimpleGUI.PySimpleGUI:main_open_github_issue',
'psgmain=PySimpleGUI.PySimpleGUI:_main_entry_point',
'psgupgrade=PySimpleGUI.PySimpleGUI:_upgrade_entry_point',
'psghelp=PySimpleGUI.PySimpleGUI:main_sdk_help',
'psgver=PySimpleGUI.PySimpleGUI:main_get_debug_data',
'psgsettings=PySimpleGUI.PySimpleGUI:main_global_pysimplegui_settings',
],}, This feature of setuptools is incredibly powerful and has enabled releasing applications to PyPI. Here is what running The QuestionThe problem I have is that I use a "local" copy of my PySimpleGUI.py file as well as the ones found in each of the Python installations. I've got .EXE files for each of the installs of PySimpleGUI for each of the Python interpreters I have on my machine. They all work great, except for under one condition. If there is a PySimpleGUI.py file found on my The way I get around this is that I run a little script that renames my PySimpleGUI.py to PySimpleGUI_.py and then I'm able to run these commands. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I believe this is expected due to the way Python works: in a regular invocation with no special flags, Python will always place the CWD in front of the other directories in
If the local --- EDIT --- See details in #3694 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
The local version has no problems in that it runs as it should, has the same entry points, etc. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for the additional information. This helped tremendously and explains why my local file has an issue as I don't have the exact same structure. Really appreciate the help! |
Beta Was this translation helpful? Give feedback.
I believe this is expected due to the way Python works: in a regular invocation with no special flags, Python will always place the CWD in front of the other directories in
sys.path
.pip
will create a wrapper for the entry-points that imports the package according to the current state ofsys.path
.If the local
PySimpleGUI.py
has problems, then the script will also have problems.--- EDIT ---
See details in #3694 (reply in thread)