PiRSquared17 / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

Google protocol buffers have conflicting namespace; manage.py gives ImportError #177

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. As part of Ubuntu One, I installed python-protobuf. Protocol Buffers are
Google's data interchange format. (The site is here:
http://code.google.com/p/protobuf/) 
2. However, protobuf uses namespace "google". This conflicts with Google
App Engine.
3. Running any manage.py commands gives an ImportError.

What is the expected output? What do you see instead?
The manage.py commands should run correctly, but I'm still getting
ImportError from setup_env() in aecmd.py.

Strangely, just using dev_appserver.py doesn't seem to have any problems
with the namespace conflict.

What version of the product are you using? On what operating system?
I'm using 1.0.2.1 of app-engine-patch and I'm on Ubuntu 9.04.

Please provide any additional information below.

Original issue reported on code.google.com by stryderjzw on 5 Jul 2009 at 1:37

GoogleCodeExporter commented 9 years ago
I have same problem
Ubuntu 9.04, by default python 2.5

user@pingvin:~/app-engine-patch-projects/app-engine-patch-sample$ python 
manage.py update
Traceback (most recent call last):
  File "manage.py", line 4, in <module>
    setup_env(manage_py_env=True)
  File
"/home/user/app-engine-patch-projects/app-engine-patch-sample/common/appenginepa
tch/aecmd.py",
line 63, in setup_env
    from appenginepatcher.patch import patch_all
  File
"/home/user/app-engine-patch-projects/app-engine-patch-sample/common/appenginepa
tch/appenginepatcher/patch.py",
line 7, in <module>
    from google.appengine.ext import db
  File "/usr/local/google_appengine/google/appengine/ext/db/__init__.py", line 88, in
<module>
    from google.appengine.api import datastore
  File "/usr/local/google_appengine/google/appengine/api/datastore.py", line 43, in
<module>
    from google.appengine.api import api_base_pb
  File "/usr/local/google_appengine/google/appengine/api/api_base_pb.py", line 18, in
<module>
    from google.net.proto import ProtocolBuffer
  File "/usr/local/google_appengine/google/net/proto/ProtocolBuffer.py", line 23, in
<module>
    from google.pyglib.gexcept import AbstractMethod
ImportError: No module named gexcept

With other commands like runserver same problems. When i run with 
dev_appserver.py
everything is fine.

Original comment by t00t...@gmail.com on 7 Jul 2009 at 6:17

GoogleCodeExporter commented 9 years ago
Could you please try the latest repo version? I tried to implement a workaround.

Original comment by wkornew...@gmail.com on 7 Jul 2009 at 6:23

GoogleCodeExporter commented 9 years ago
The workaround in the repo fixes the issue for me.

Original comment by dvd...@gmail.com on 8 Jul 2009 at 2:07

GoogleCodeExporter commented 9 years ago
Great! Thanks for reporting the issue!

Original comment by wkornew...@gmail.com on 8 Jul 2009 at 7:50

GoogleCodeExporter commented 9 years ago
I am getting the same problem mentioned here in both 1.0.2.3 and 1.1RC. Where 
is the
repo version you mentioned?

Original comment by yyqu...@gmail.com on 7 Aug 2009 at 6:31

GoogleCodeExporter commented 9 years ago
I had the same problem and it turned out that gexcept.py file in
/usr/local/google_appengine/google/pyglib folder didn't have read permission 
granted
to everybody. Running chmod helped me.

Original comment by dstal...@gmail.com on 8 Aug 2009 at 8:12

GoogleCodeExporter commented 9 years ago
dstainov: thanks for that. I tried your suggestion but now have another error. 

File "/usr/local/google_appengine/google/appengine/api/datastore.py", line 45, 
in
<module>
    from google.appengine.api import datastore_errors
ImportError: cannot import name datastore_errors

Here is what I have done so far. I am using Ubuntu 9.04 AMD674.
1) Downloaded appengine (1.2.4) files and put them at /usr/local. I have also 
chmod
the permissions on gexcept.py.
2) Downloaded the file app-engine-patch-1.0.23.zip and unzipped to a folder 
under my
user directory. I have also tried the 1.1RC.
3) Execute "python manage.py runserver" on the command line.

Any suggestions will be greatly appreciated!

Original comment by yyqu...@gmail.com on 11 Aug 2009 at 6:31

GoogleCodeExporter commented 9 years ago
Have you checked that
/usr/local/google_appengine/google/appengine/api/datastore_errors.py has read
permission for the user you are using? Personally, I had to run "chmod -R a+r 
." in
/usr/local/google_appengine folder, because many different files and libraries 
had
read permission missing.

Once I have fixed the permissions issue the server started up for me without 
problems.

Original comment by dstal...@gmail.com on 11 Aug 2009 at 7:24

GoogleCodeExporter commented 9 years ago
dstainov: thanks. After the suggested changes, I was able to at least start the
server. However, it turns out that since I am using Ubuntu 9.04, the default 
Python
version is 2.6 which is not yet supported by appengine, I will try to look for
another PC having Python 2.5 before trying again.

http://code.google.com/p/googleappengine/issues/detail?id=1159

Original comment by yyqu...@gmail.com on 11 Aug 2009 at 9:43

GoogleCodeExporter commented 9 years ago
I ran into this issue on Ubuntu with Google App Engine helper but searching for 
the exception led me to this error.  In my case, when I looked closer, I saw 
this warning right before the import error:

WARNING:root:Blocking access to skipped file 
"/my/working/dir/.google_appengine/google/appengine/ext"

Until I saw that warning I was confused because this worked fine up to 
importing ext:

import google
import google.appengine
import google.appengine.ext <- problem

It turns out the culprit is in 
google.appengine.tools.dev_appserver:FakeFile._IsFileAccessibleNoCache.
It makes a regex pattern like this (somehow):

p = re.compile('^(.*/)?((#.*#)|(.*~)|(.*\.py[co])|(.*/RCS/.*)|(\..*)|)$')

and when the ext submodule gets imported it triggers a match:

>>> p.match('/my/working/dir/.google_appengine/google/appengine/ext')
<_sre.SRE_Match object at 0x10031d7c8>

so this blocks access to the ext submodule in dev_appserver.py on line 1171

I don't know how to fix it yet but this is the root cause and it might also be 
the cause for others, I'm not sure.

Original comment by kumar.mcmillan on 14 Nov 2010 at 6:07

GoogleCodeExporter commented 9 years ago
arggh, I meant to post that to Issue 174.  Disregard.  Sorry :(

Original comment by kumar.mcmillan on 14 Nov 2010 at 6:19