nithinmurali / pygsheets

Google Sheets Python API v4
https://pygsheets.readthedocs.io/en/latest
Other
1.51k stars 220 forks source link

Pygsheets crashing when compiled as EXE #493

Closed LuigiBrito closed 3 years ago

LuigiBrito commented 3 years ago

Describe the bug When compiling a python script that uses pygsheets, the executable always fails. This bug has been previously reported on https://github.com/nithinmurali/pygsheets/issues/200 and https://github.com/nithinmurali/pygsheets/issues/341 but none really specifies what NEEDS to be done to make it work. I have a ton of client.py in my system and scattered inside the python base folder.

Should I be downloading which py and editing which py to include in which py?

To Reproduce Steps to reproduce the behavior:

pyinstaller -F C:\Users\JohnDoe\PycharmProjects\SomeProject\main.py
from the console, run main.exe
# see error
[Errno 2] No such file or directory: 'C:\\Users\\.........\\pygsheets\\data\\sheets_discovery.json'

System Information

nithinmurali commented 3 years ago

can you please try installing the staging version and check if it's working?

pip install https://github.com/nithinmurali/pygsheets/archive/staging.zip

LuigiBrito commented 3 years ago

@nithinmurali

God bless you that worked. I had to uninstall the pygsheets first, then installed this staging version. THEN it worked!!! Thank you

mlo31415 commented 3 years ago

I have the same problem. I uninstalled pygsheets 2.0.5, confirmed that it was gone, and then ran "pip install https://github.com/nithinmurali/pygsheets/archive/staging.zip". It reported "Successfully installed pygsheets-2.0.5 ". I re-ran the EXE build, but I still can't run the EXE it produces. (The program runs in the Pycharm IDE.) When I run it I get the messages:

Traceback (most recent call last): File "ProgramAnalyzer.py", line 6, in ModuleNotFoundError: No module named 'pygsheets'

I'd appreciate any help with this!

nithinmurali commented 3 years ago

@mlo31415 your issue is different from one mentioned here. i think in your case pygsheets is not installed in the env you are using. dosent look like a pygsheets specific issue.

mlo31415 commented 3 years ago

Using Pycharm, I see pygsheets 2.0.5 installed, and the program runs under the debugger only when it shown as installed. (I tested it before uninstalling, after uninstalling, and then after re-installing from Github.) Is there some other test which would clarify things?

LuigiBrito commented 3 years ago

@mlo31415 you could have installed it on a virtual env. not the same env the pyinstaller uses. definitely a different problem

On Sat, Jul 10, 2021 at 5:19 AM mlo31415 @.***> wrote:

Using Pycharm, I see pygsheets 2.0.5 installed, and the program runs under the debugger only when it shown as installed. (I tested it before uninstalling, after uninstalling, and then after re-installing from Github.) Is there some other test which would clarify things?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/nithinmurali/pygsheets/issues/493#issuecomment-877461887, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALTAETCMPZBQ7DFNQXBOW4TTW5RVTANCNFSM45OWL7PA .

mlo31415 commented 3 years ago

Good catch! While I had all my packages installed in the venv, I was using a pyinstaller.exe that was off in the Python38 directory. I repointed my build.bat to the venv and it works.

Many thanks for your help!

Jarige commented 2 years ago

So I've experienced this exact problem today. It seems like the pip repositories still have the unfixed version of pygsheets. Is there any chance this fix will be rolled out so that I do not have to manually patch my venv?