Giter VIP home page Giter VIP logo

Comments (7)

onejgordon avatar onejgordon commented on June 18, 2024

It looks like this error can arise when running the scripts with something other than bash.

If so, I wonder if this is related to the shell configuration in your container, as implied by this SO question. Might be worth trying running the script explicitly with bash, and also changing the hash bang to !/bin/bash to see if that helps.

from flow-dashboard.

jackmcdougal avatar jackmcdougal commented on June 18, 2024

Thanks! That was the issue. Changing the hash bang to !/bin/bash worked. (or running bash ./deploy.sh 0-1)

I then had to specify my python path at the top of the runtest.py (my container had nothing at /usr/bin/python)

I then ran into an error that was solved by changing line 41 in runtests.py from
print 'Error: 2+ arguments required.'
to
print ('Error: 2+ arguments required.')

I also had to modify run_tests.sh to properly specify my google-sdk path - which wasn't in my home folder.

Now I have another exception ... but before I keep hammering away at this: I noticed the devappserver won't run locally because one of the libraries doesn't support python2.7 any more.

I think I am running python3.8 for all of the above ... is it reasonable to assume this app will run on Ubuntu 20.04?

Thanks!

from flow-dashboard.

onejgordon avatar onejgordon commented on June 18, 2024

Thanks for that, I'm updating the bash script accordingly as well.

As for the new exception, it's true that we're still using the python2.7 runtime in gcloud. However, I'm able to run the dev app server locally (on a mac) without issue, as well as execute deploys to production. Which library are you seeing lack of support? It could be that there are support differences on Ubuntu.

In general, this codebase is in bad need of a refresh and upgrade to Python 3, and it's just not something I have time for at the moment, unfortunately.

from flow-dashboard.

jackmcdougal avatar jackmcdougal commented on June 18, 2024

so when running the devapp server, I get this:

ERROR    2022-07-15 16:50:36,129 wsgi.py:267] 
Traceback (most recent call last):
  File "/home/myusername/flowdashboard-macs/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/runtime/wsgi.py", line 238, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/home/myusername/flowdashboard-macs/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/runtime/wsgi.py", line 309, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/home/myusername/flowdashboard-macs/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/runtime/wsgi.py", line 83, in LoadObject
    obj = __import__(path[0])
  File "/home/myusername/flowdashboard-macs/flow-dashboard/flow.py", line 7, in <module>
    import api
  File "/home/myusername/flowdashboard-macs/flow-dashboard/api.py", line 8, in <module>
    from oauth2client import client
  File "/home/myusername/flowdashboard-macs/flow-dashboard/lib/oauth2client/client.py", line 38, in <module>
    from oauth2client import transport
  File "/home/myusername/flowdashboard-macs/flow-dashboard/lib/oauth2client/transport.py", line 17, in <module>
    import httplib2
  File "/home/myusername/flowdashboard-macs/flow-dashboard/lib/httplib2/__init__.py", line 396
    print("%s:" % h, end=" ", file=self._fp)
                        ^
SyntaxError: invalid syntax
INFO     2022-07-15 16:50:36,135 module.py:890] default: "GET /_ah/warmup HTTP/1.1" 500 -

Googling I found this thread:

https://stackoverflow.com/questions/56731694/how-to-fix-prints-h-end-file-self-fp-syntaxerror-invalid-synta

Thanks again for the support! I have no coding experience/training so I not sure I could help. Is migrating to python3 a big job? Could something like this work? https://docs.python.org/3/library/2to3.html

from flow-dashboard.

onejgordon avatar onejgordon commented on June 18, 2024

The github issue linked from the SO question you linked (googleapis/google-api-python-client#704) does seem to imply there is still support for python 2 in older versions of httplib.

If you installed the python dependencies using pip install -t lib, you should have httplib2 in the ./lib directory. Can you check its version by looking at the __version__ declaration at the top of the __init__.py?

In my install, I'm seeing 0.10.3. This is the version that was installed by the google_api_python_client version 1.5.1, I believe.

As for upgrading to python3, unfortunately it's not as easy as updating the code itself (which as you found, is quite manageable). It's the dependencies (with the google python api client as a good example) and use of various GCP libraries and APIs that would need to be updated as well, which makes it a bigger task. All doable, of course.

from flow-dashboard.

jackmcdougal avatar jackmcdougal commented on June 18, 2024

Thanks again.

Odd ... I have version = "0.20.4" in mine. I did install `from:

pip install -t lib -r requirements.txt pip install -r local.requirements.txt

my requirements.txt shows: google_api_python_client==1.5.1 too ...

from flow-dashboard.

onejgordon avatar onejgordon commented on June 18, 2024

Ok, I think it's worth a try then to downgrade httplib2. You should be able to do this by deleting the urllib2 folder from lib, adding httplib2==0.10.3 to requirements.txt at the top, and then re-running the pip install -t lib -r requirements.txt command.

from flow-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.