Comments (8)
@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.
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.
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.
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.
@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.
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.
Fixed & released as part of 0.5 :)
from invoke.
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)
- Change default shell without a config file or Context? HOT 3
- Task decorator removes docstring HOT 1
- Run tasks relative to `tasks.py` HOT 2
- How to manually set short flags? HOT 1
- context.run(): Expose API to pass command and separate args instead of a single string HOT 2
- Specify a config file per Collection... possible?
- Collection mix-up when cross importing invoke tasks
- Running post tasks even if the main task fail
- `--help` after the command treats `--help` as positional argument HOT 2
- Is there support for making invoke.yaml context settings cli flags?
- EncodeWarning's when running on python >= 3.11
- @task(pre=[call(setup, 'qwe')]) fails with "NameError: name 'call' is not defined" HOT 1
- Config run should handle shell paths with spaces HOT 2
- Is it possible to only mock one command and run the rest with MockContext?
- autoprint generators correctly
- Generate help infomation of task args from function docstring.
- Importing Python modules from a scripts directory beside the tasks directory
- Recommended way to forward arguments to commands HOT 2
- Printing Promise objects from asynchronous Runner.run() raises Attribute Error
- Sudo showing password in clear
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoke.