seomoz / shovel

Rake, for Python
MIT License
660 stars 49 forks source link

RuntimeWarning: Parent module '' not found while handling absolute import #36

Closed suredream closed 7 years ago

suredream commented 7 years ago

$ pip install shovel

~/.shovel.py

from shovel import task
@task
def hello():
    '''Prints hello and the provided name'''
    print 'Hello'

Juns-MacBook-Air:blog jxiong1$ shovel hello /Users/jxiong1/.shovel.py:2: RuntimeWarning: Parent module '' not found while handling absolute import from shovel import task Hello

b4hand commented 7 years ago

What version of Python are you running?

suredream commented 7 years ago

Python 2.7.13

On Mon, Apr 10, 2017 at 5:24 PM, Brandon Forehand notifications@github.com wrote:

What version of Python are you running?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/seomoz/shovel/issues/36#issuecomment-293115188, or mute the thread https://github.com/notifications/unsubscribe-auth/ABlYlVN4wetYfynf3OPZWPJGs-9MUIOuks5rusg8gaJpZM4M4FYN .

-- Jun Xiong, Ph.D. U.S. Geological Survey 2255 North Gemini Drive, Flagstaff, AZ, USA. Office: 928-556-7215

b4hand commented 7 years ago

For Python 2, you'll need to add the following to the top of your ~/.shovel.py file in order to avoid the warning:

from __future__ import absolute_import