Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named google_compute_engine #693

Open
cleverca22 opened this issue Jun 24, 2017 · 8 comments
Open

ImportError: No module named google_compute_engine #693

cleverca22 opened this issue Jun 24, 2017 · 8 comments

Comments

@cleverca22
Copy link
Contributor

https://travis-ci.org/cleverca22/nixops-bug/branches
https://github.com/cleverca22/nixops-bug/branches

after several days of trying to figure out why nearly identical .travis.yml files had entirely different outcomes, i tracked it down
the mere presence of a sudo command in the .travis.yml file causes travis to use a different version of ubuntu (14.04 with sudo, 12.04 without sudo)

and there is an impurity somewhere within nixops, that causes it to fail under 14.04

@domenkozar
Copy link
Member

The gist is:

$ nixops --version
Traceback (most recent call last):
  File "/nix/store/cjpnvn1fdimq960xslzyxlg4nc53gzlc-nixops-2017-05-22/bin/..nixops-wrapped-wrapped", line 5, in <module>
    from nixops import deployment
  File "/nix/store/cjpnvn1fdimq960xslzyxlg4nc53gzlc-nixops-2017-05-22/lib/python2.7/site-packages/nixops/deployment.py", line 1207, in <module>
    _load_modules_from("backends")
  File "/nix/store/cjpnvn1fdimq960xslzyxlg4nc53gzlc-nixops-2017-05-22/lib/python2.7/site-packages/nixops/deployment.py", line 1205, in _load_modules_from
    __import__("nixops." + dir + "." + module[:-3], globals(), locals())
  File "/nix/store/cjpnvn1fdimq960xslzyxlg4nc53gzlc-nixops-2017-05-22/lib/python2.7/site-packages/nixops/backends/ec2.py", line 10, in <module>
    import boto.ec2
  File "/nix/store/3nvdlwjppqw3vs53nk7wrncs87akgqcj-python2.7-boto-2.47.0/lib/python2.7/site-packages/boto/__init__.py", line 1216, in <module>
    boto.plugin.load_plugins(config)
  File "/nix/store/3nvdlwjppqw3vs53nk7wrncs87akgqcj-python2.7-boto-2.47.0/lib/python2.7/site-packages/boto/plugin.py", line 93, in load_plugins
    _import_module(file)
  File "/nix/store/3nvdlwjppqw3vs53nk7wrncs87akgqcj-python2.7-boto-2.47.0/lib/python2.7/site-packages/boto/plugin.py", line 75, in _import_module
    return imp.load_module(name, file, filename, data)
  File "/usr/lib/python2.7/dist-packages/google_compute_engine/boto/compute_auth.py", line 19, in <module>
    from google_compute_engine import logger
ImportError: No module named google_compute_engine

I see that wrapping logic changed in /nix/store/0ynq648rqsr22xsdmiis29wff3vikdcb-nixops-1.5/bin/..nixops-wrapped-wrapped, maybe @FRidh can help us here :)

@FRidh
Copy link
Member

FRidh commented Jun 26, 2017

@domenkozar what specifically changed? wrapPythonPrograms now only wraps inside /bin, and we "fixed" pip by using a newer pkg_resources but aside from that nothing has changed.

Is the sandbox used when building on Travis?

@cleverca22
Copy link
Contributor Author

- export PYTHONPATH= doesn't fix nixops under a 14.04 travis

@spinus
Copy link
Member

spinus commented Jul 4, 2017

GoogleCloudPlatform/compute-image-packages#262 - probably related

@domenkozar
Copy link
Member

domenkozar commented Jul 4, 2017

@cleverca22 can you try sudo rm -f /etc/boto.cfg?

I have pushed google-compute-engine python package in 0945a5b462c228595fbbc5df42ffca72bc1ebcdc, but of course it has a cyclic dependency on boto.

@domenkozar
Copy link
Member

Travis-ci issue: travis-ci/travis-ci#7940

@spinus
Copy link
Member

spinus commented Jul 4, 2017

my workaround is adding: sudo rm /etc/boto* to before_script

@josegonzalez
Copy link

You can also set export BOTO_CONFIG=/dev/null whenever you run tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants