sjkingo / python-freshdesk

An API for the Freshdesk helpdesk
BSD 2-Clause "Simplified" License
87 stars 67 forks source link

Unable to install on Google App Engine #51

Closed krutijan1 closed 4 years ago

krutijan1 commented 4 years ago

Hello,

I am struggling to make it work on google app engine deployment and/or local google devapp_server.py. It fails by the required module not found. In clean python 3 virtual env it runs smoothly.

    return self.load_wsgiapp()
  File "/private/var/folders/sb/b543pgd17kv9rtth8fn8cxs40000gn/T/tmpV2v7jH/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/private/var/folders/sb/b543pgd17kv9rtth8fn8cxs40000gn/T/tmpV2v7jH/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/jankrutina/Projects/Revolgy/myservices-module/main.py", line 22, in <module>
    from app.tickets import tickets
  File "/Users/jankrutina/Projects/Revolgy/myservices-module/app/tickets.py", line 4, in <module>
    from freshdesk.api import API
  File "/Users/jankrutina/Projects/Revolgy/myservices-module/freshdesk.py", line 1, in <module>
    from freshdesk.api import API
ModuleNotFoundError: No module named 'freshdesk.api'; 'freshdesk' is not a package

Steps to reproduce: install google cloud sdk locally:

entrypoint: gunicorn -b :$PORT main:app --preload


- run local server with ./google-cloud-sdk/bin/dev_appserver.py --port=8080 --enable_console=true app.yaml
- after hitting address localhost:8080 module is not loaded

Do you have please any ideas what this problem could be?

Thanks
sjkingo commented 4 years ago

Hi there, thanks for the detailed report. I don't know off the top of my head.

I'm going to try this myself on GAE and do some debugging. Will get back to you soon!

krutijan1 commented 4 years ago

Hi, thanks for the reply. I had created in my project root folder file called freshdesk.py for testing purposes, which I think was the root cause of this issue. The module loader was trying to load the file instead of the module. After removing it started to work as expected. I am sorry for not informing you sooner, so you do not have to spend time on this. Thanks a lot again.

sjkingo commented 4 years ago

That's great to hear. No need to apologise :-)