Giter Club home page Giter Club logo

Comments (8)

treyhunner avatar treyhunner commented on July 19, 2024

@davidfischer it looks like six is a dependency. Also invocations is a dependency and it must be installed from the git repository because it's not on PyPI yet.

from invoke.

bitprophet avatar bitprophet commented on July 19, 2024

Yea, this is my bad, the vendored copy of lexicon inside Invoke is trying to globally import six, which won't exist unless you install it manually (which is a legit workaround for now). I'll figure out a fix and update things soon. Thanks!

from invoke.

bitprophet avatar bitprophet commented on July 19, 2024

Just pushed a fix. I'm not proud of it, but I can now run Invoke in a virtualenv that has no global 'six' installed. Please reopen if this somehow didn't fix it for you, @davidfischer !

from invoke.

justinmayer avatar justinmayer commented on July 19, 2024

Just ran into a similar problem with Invoke 0.4.0 on Mac OS X 10.8.4, Homebrew Python 3.3.2:

> virtualenv -p /usr/local/bin/python3 testenv
> (testenv) pip install invoke
> (testenv) pip list --local
invoke (0.4.0)
pip (1.4.1)
setuptools (0.9.8)

Don't see six in the above list, and I don't have it installed globally. Let's try an invocation:

> (testenv) invoke --install python-deps
Traceback (most recent call last):
File "/virtualenvs/testenv/bin/invoke", line 9, in <module>
    load_entry_point('invoke==0.4.0', 'console_scripts', 'invoke')()
File "/virtualenvs/testenv/lib/python3.3/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
File "/virtualenvs/testenv/lib/python3.3/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
File "/virtualenvs/testenv/lib/python3.3/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/virtualenvs/testenv/lib/python3.3/site-packages/invoke/__init__.py", line 2, in <module>
    from .tasks import task, ctask, Task
File "/virtualenvs/testenv/lib/python3.3/site-packages/invoke/tasks.py", line 11, in <module>
    from .context import Context
File "/virtualenvs/testenv/lib/python3.3/site-packages/invoke/context.py", line 3, in <module>
    from .runner import run
File "/virtualenvs/testenv/lib/python3.3/site-packages/invoke/runner.py", line 6, in <module>
    from .vendor import pexpect
File "/virtualenvs/testenv/lib/python3.3/site-packages/invoke/vendor/pexpect.py", line 93, in <module>
    from .. import six
ImportError: cannot import name six

Any thoughts? Let me know if you'd prefer this in a new issue.

from invoke.

bitprophet avatar bitprophet commented on July 19, 2024

@justinmayer I can recreate this under Python 3 (but not Python 2) - interestingly it's not caught by our test suite/CI because the test runner itself has a non-vendored dependency on 'six' (whereas in normal, non dev/test situations, Invoke relies on its vendored copy of 'six' - thus the from .. import six.)

Not sure why a relative import is picking up a 'global' install, I guess that fallback is on purpose.

And of course, not sure why the core problem exists: Python 3 breaks the relative importing. Could swear I had some folks using this under Python 3 previously. Will poke a bit.

from invoke.

bitprophet avatar bitprophet commented on July 19, 2024

Yea that's my bad, it needs to be from . import six - the .. was leftover from when pexpect was vendorized one level deeper.

Python 2 appears to pick up the relative 'six' in a non-relative import (i.e. import six was finding the vendorized six under Python 2 - but not Python 3).

Simplifying and fixing that entire import block; it seems to work for me without any global six installed, under both interpreters.

Thanks & sorry @justinmayer! Will release this change today.

from invoke.

bitprophet avatar bitprophet commented on July 19, 2024

Fixed & released as part of 0.5 :)

from invoke.

justinmayer avatar justinmayer commented on July 19, 2024

No apologies necessary, Jeff. On the contrary — thanks for jumping on this so quickly and pushing a release containing the fix. You rock!

from invoke.

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.