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

"shovel help" fails with "ImportError: cannot import name task" (filename conflict) #7

Open
npinto opened this issue Mar 28, 2012 · 4 comments

Comments

@npinto
Copy link

npinto commented Mar 28, 2012

Steps to reproduce:

virtualenv shovel-test
cd shovel-test
source bin/activate
git clone https://github.com/seomoz/shovel.git
cd shovel
python setup.py install
cd ../
mkdir sandbox
cd sandbox
ln -sf ../shovel/shovel.py .
shovel help

Output:

Traceback (most recent call last):
  File "/home/npinto/.local/bin/shovel", line 41, in <module>
    import shovel
  File "/home/npinto/tmp/shovel-test/sandbox/shovel.py", line 1, in <module>
    from shovel import task
ImportError: cannot import name task
[1]    31729 exit 1     shovel help
@harobed
Copy link

harobed commented Dec 20, 2012

Same issue here 👍

@cory-klein
Copy link
Contributor

Just saw this myself. In some cases the python interpreter appears to be looking for task from within your shovel.py itself, rather than looking for the global shovel module.

You can resolve this by creating a shovel directory and moving your shovel.py into it:

mkdir shovel
mv shovel.py
shovel <your_task> # should work now

@dlecocq
Copy link

dlecocq commented Jan 25, 2018

In hindsight, it was probably not a good idea to have the module named the same as where it tries to load tasks, but @cory-klein -- that is the best work-around.

@FilBot3
Copy link

FilBot3 commented Aug 24, 2019

could it be renamed to something like shovellib/?

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

No branches or pull requests

5 participants