gana2188 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

gcutil does not find cloud.sdk.core.util #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install gcutils using curl 
https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash
2. gcloud auth login
3. run "gcutil"

What is the expected output? What do you see instead?

gcutil
Traceback (most recent call last):
  File "/home/zeno/.software/google-cloud-sdk/bin/gcutil", line 11, in <module>
    import bootstrapping.bootstrapping as bootstrapping
  File "/home/zeno/.software/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 16, in <module>
    import setup
  File "/home/zeno/.software/google-cloud-sdk/bin/bootstrapping/setup.py", line 23, in <module>
    from google.cloud.sdk.core.util import platforms
ImportError: No module named cloud.sdk.core.util

What version of the product are you using? On what operating system?

lateste version on Gentoo Linux.

Please provide any additional information below.

I would like to login to my Google Could instance useing ssh:

gcutil ssh my-first-instance

but this always gives me the error:

gcutil
Traceback (most recent call last):
  File "/home/zeno/.software/google-cloud-sdk/bin/gcutil", line 11, in <module>
    import bootstrapping.bootstrapping as bootstrapping
  File "/home/zeno/.software/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 16, in <module>
    import setup
  File "/home/zeno/.software/google-cloud-sdk/bin/bootstrapping/setup.py", line 23, in <module>
    from google.cloud.sdk.core.util import platforms
ImportError: No module named cloud.sdk.core.util

Original issue reported on code.google.com by zdav...@ywesee.com on 3 Dec 2013 at 12:34

GoogleCodeExporter commented 9 years ago
BTW gcutil will not work with python 3.3:

gcutil 
Traceback (most recent call last):
  File "/home/zeno/.software/google-cloud-sdk/bin/gcutil", line 11, in <module>
    import bootstrapping.bootstrapping as bootstrapping
  File "/home/zeno/.software/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 261
    print textwrap.dedent("""\
                 ^
SyntaxError: invalid syntax

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 12:43

GoogleCodeExporter commented 9 years ago
Same error with python 3.2.5

~> python
Python 3.2.5 (default, Oct 10 2013, 12:39:05) 
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
~> gcutil 
Traceback (most recent call last):
  File "/home/zeno/.software/google-cloud-sdk/bin/gcutil", line 11, in <module>
    import bootstrapping.bootstrapping as bootstrapping
  File "/home/zeno/.software/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 261
    print textwrap.dedent("""\
                 ^
SyntaxError: invalid syntax

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 12:45

GoogleCodeExporter commented 9 years ago
The Google Cloud SDK is not compatible with Python 3.x; it currently requires 
Python 2.7.x

Regarding the initial error report, do you have any other Google Python 
packages installed, and do you have your PYTHONPATH environment variable set to 
anything specific?

Original comment by markp...@google.com on 3 Dec 2013 at 3:09

GoogleCodeExporter commented 9 years ago
thanks for the reply. I have appengine-java-sdk-1.8.8 in my /tmp/ dir.

echo $PYTHONPATH
/var/www

where should $PYTHONPATH point to?

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 3:14

GoogleCodeExporter commented 9 years ago
PYTHONPATH does not need to be set for the Cloud SDK to work, and I think a bug 
I just found is causing it to behave oddly if it is set.  If you unset it, I 
would expect things to work for you.  Just to confirm my findings (and to fix 
the bug), is there a 'google' directory in your /var/www?

Original comment by markp...@google.com on 3 Dec 2013 at 3:20

GoogleCodeExporter commented 9 years ago
no there is no google dir in /var/www ;)

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 3:27

GoogleCodeExporter commented 9 years ago
unsetting PYTHONPATH does not help:

~> unset PYTHONPATH
~> echo $PYTHONPATH

~> gcutil
Traceback (most recent call last):
  File "/home/zeno/.software/google-cloud-sdk/bin/gcutil", line 11, in <module>
    import bootstrapping.bootstrapping as bootstrapping
  File "/home/zeno/.software/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 16, in <module>
    import setup
  File "/home/zeno/.software/google-cloud-sdk/bin/bootstrapping/setup.py", line 23, in <module>
    from google.cloud.sdk.core.util import platforms
ImportError: No module named cloud.sdk.core.util

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 3:29

GoogleCodeExporter commented 9 years ago
I had 

export PYTHONPATH=/var/www

in my 

/home/zeno/.bashrc

file. I commented out that line but still get the same error after restarting 
my bash.

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 3:41

GoogleCodeExporter commented 9 years ago
Interesting.  Ok, can you please run the following:

env | grep CLOUDSDK
env | grep PYTHON
python -c "import sys;print sys.path"

Original comment by markp...@google.com on 3 Dec 2013 at 3:42

GoogleCodeExporter commented 9 years ago
~> env | grep CLOUDSDK (no output)
~> env | grep PYTHON (no output)
~> python -c "import sys;print sys.path"
['', 
'/usr/lib64/python2.7/site-packages/django_threaded_multihost-1.4_1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/South-0.7.6-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/Coffin-0.3.7-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/django_recaptcha_works-0.3.4-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/markdown2-2.1.0-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/lamson-1.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/akismet-0.2.0-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/django_countries-1.0.5-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/django_kombu-0.9.2-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/html5lib-0.90-py2.7.egg', 
'/home/zeno/.software/askbot-devel', 
'/usr/lib64/python2.7/site-packages/Django-1.3.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/django_keyedcache-1.4_6-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/django_robots-0.8.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/django_celery-2.2.7-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/pystache-0.3.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/python_openid-2.2.5-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/oauth2-1.5.211-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/Unidecode-0.04.9-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/django_followit-0.0.3-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/python_daemon-1.6-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/nose-1.2.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/mock-1.0b1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/chardet-2.1.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/celery-2.2.7-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/django_picklefield-0.2.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/httplib2-0.7.6-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/lockfile-0.9.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/pyparsing-1.5.6-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/kombu-1.5.1-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/anyjson-0.3.3-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/python_dateutil-1.5-py2.7.egg', 
'/usr/lib64/python2.7/site-packages/amqplib-1.0.2-py2.7.egg', 
'/usr/lib64/python27.zip', '/usr/lib64/python2.7', 
'/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', 
'/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', 
'/usr/lib64/python2.7/site-packages', 
'/usr/lib64/python2.7/site-packages/gtk-2.0', 
'/usr/lib64/python2.7/site-packages', 
'/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode']

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 3:45

GoogleCodeExporter commented 9 years ago
python version is: 

~> python
Python 2.7.6+ (2.7:b6377ca8087a+, Dec  3 2013, 14:06:07) 
[GCC 4.6.4] on linux2

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 3:46

GoogleCodeExporter commented 9 years ago
How about this:

python -c "import google;print google.__file__"

Original comment by markp...@google.com on 3 Dec 2013 at 3:49

GoogleCodeExporter commented 9 years ago
~> python -c "import google;print google.__file__"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute '__file__'

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 3:50

GoogleCodeExporter commented 9 years ago
does this help (some python is there):

~> emerge --info | grep PYTHON
USE="X X* amd64 apache2 bzip2 cairo consolekit corefonts cracklib crypt cxx 
dbus dga firefox gd gdbm gnome gtk iconv icu ipv6 java jpeg jpg libkms libxml2 
midi minizip mmx modules mudflap multilib mysql ncurses nls nptl openmp otr pam 
pcre pdo php png policykit python readline redis resolvconf ruby skype sse sse2 
ssl tcpd tif tiff tk unicode webgl wmf xml yaml zlib" ABI_X86="64" 
APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm 
authn_default authn_file authz_dbm authz_default authz_groupfile authz_host 
authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir 
disk_cache env expires ext_filter file_cache filter headers include info 
log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling 
status unique_id userdir usertrack vhost_alias proxy proxy_http cgi cgid" 
CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon 
braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory 
rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate 
evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom 
oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip 
tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics keyboard mouse" 
KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 
mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console 
presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" 
PYTHON_ABIS="2.7 3.3" PYTHON_SINGLE_TARGET="python2_7" 
PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" 
QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18 ruby19 ruby20" 
USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options 
ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark 
ipmark dhcpmac delude chaos account"

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 3:57

GoogleCodeExporter commented 9 years ago
Thanks for your help in debugging this issue.  It looks like one of the python 
site packages you have installed (not sure which one) is interfering with our 
code.  To get around this for now, you should be able to run:

python -S gcutil

We will look into how we can better isolate the code, and should have a fix 
soon.

Original comment by markp...@google.com on 3 Dec 2013 at 4:18

GoogleCodeExporter commented 9 years ago
thanks! this works:

python -S /home/zeno/.software/google-cloud-sdk/bin/gcutil

[ this did not work: 

~> python -S gcutil
/usr/bin/python2.7: can't open file 'gcutil': [Errno 2] No such file or 
directory ]

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 4:21

GoogleCodeExporter commented 9 years ago
One more thing if you don't mind:

ls -l /usr/lib64/python2.7/site-packages

tail -n +1 /usr/lib64/python2.7/site-packages/*.pth
tail -n +1 /usr/lib64/python2.7/site-packages/*.py

Original comment by markp...@google.com on 3 Dec 2013 at 4:56

GoogleCodeExporter commented 9 years ago
Ok, see attachments. ;)

Original comment by zdav...@ywesee.com on 3 Dec 2013 at 5:50

Attachments:

GoogleCodeExporter commented 9 years ago
Hi-
    I am also a Gentoo user with Python 2.7 as my default, the latest google-cloud-sdk installed, the same error, and protobuf 2.5.0 installed.  Temporarily moving protobuf-2.5.0-py2.7-nspkg.pth and protobuf-2.5.0-py2.7.egg-info/ (moving /usr/lib64/python2.7/site-packages/google/protobuf out isn't necessary) solves the problem.  It would appear that the system install of Protocol Buffers is treading on the Google Cloud SDK's module namespace, but I am unsure how.  Hopefully this information is useful.  I can also file a bug against bugs.gentoo.org, but I'm unfamiliar enough with Python that I would be unsure how to word the report or what an ideal fix would be.  Thank you guys for your time and attention on this.

        -Robin K.

Original comment by robin.ka...@gmail.com on 11 Dec 2013 at 1:01

GoogleCodeExporter commented 9 years ago
We released an updated SDK yesterday that should fix this issue.  Please run:

gcloud components update

and try again.  Please reopen this issue if you are still having problems.

Original comment by markp...@google.com on 18 Dec 2013 at 4:35

GoogleCodeExporter commented 9 years ago
Thank you! If I find anything else I will let you know.

Original comment by zdav...@gmail.com on 18 Dec 2013 at 4:41

GoogleCodeExporter commented 9 years ago
Issue 3 has been merged into this issue.

Original comment by markp...@google.com on 26 Dec 2013 at 5:34