Hi, I tried using it in PyCharm and although everything is loaded in the 
virtual env that I am using, and is accessible, psutil will not in a 
PyCharm GAE environment, aka the following call

     from google.cloud import pubsub_v1

This imports types which in turn imports psutil and gives an import error

However, psutil it loads in a standard vanilla Python environment using the 
same virtualenv

To make sure it wasn't something more sinister I did a simple test of each:


*Standard PyCharm Vanilla Python Project:*


*main.py contains*

import psutil def x(): print "hello world" if __name__ == "__main__": x()

 
*Google App Engine Project - main.py contains*

import webapp2 import psutil class MainHandler(webapp2.RequestHandler): def 
get(self): self.response.write('Hello world!') app = webapp2.WSGIApplication([ 
('/', MainHandler) ], debug=True)

 The import in the vanilla python project works fine, but the import in the 
GAE app returns the traceback:


Traceback (most recent call last): File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py"
, line 240, in Handle handler = _config_handle.add_wsgi_middleware(self.
_LoadHandler()) File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py"
, line 299, in _LoadHandler handler, path, err = LoadObject(self._handler) 
File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py"
, line 85, in LoadObject obj = __import__(path[0]) File "/Users/chez 
1/google-app-engine-projects/untitled/main.py", line 18, in <module> import 
psutil ImportError: No module named psutil 

>
> 1) Pub/sub is not in beta, even if some related gcloud commands contain 
> the "beta" word. 
> 2) You can use Pub/sub with GAE Standard, as documented on the "Cloud 
> Pub/Sub Client Libraries" page 
> <https://cloud.google.com/pubsub/docs/reference/libraries>. The old 
> posting you refer to refers another thread where the issue is closed. 
> 3) You may decide upon the best environment for your app independently of 
> the way Pub/sub is to be implemented for each environment. The above linked 
> page recommends using the older Google APIs Client Libraries if running on 
> Google App Engine standard environment. You are encouraged to read more 
> about the client libraries for Cloud APIs in Client Libraries Explained 
> <https://cloud.google.com/apis/docs/client-libraries-explained>.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/d19d0512-2213-46ac-8a74-0f0e78ed4c38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine]... Richard Cheesmar
    • [google-appen... 'George (Cloud Platform Support)' via Google App Engine
      • [google-a... Richard Cheesmar
        • [goog... 'George (Cloud Platform Support)' via Google App Engine
          • [... Richard Cheesmar
            • ... Richard Cheesmar
              • ... Richard Cheesmar
                • ... 'George (Cloud Platform Support)' via Google App Engine
                • ... Richard Cheesmar
                • ... 'Josh Moore' via Google App Engine
                • ... cccheng
                • ... cccheng

Reply via email to