amitt001 / delegator.py

Subprocesses for Humans 2.0.
MIT License
1.7k stars 92 forks source link

module 'delegator' has no attribute 'run' #35

Closed leafonsword closed 7 years ago

leafonsword commented 7 years ago

I'm using Python 3.6.3, I install delegator 0.0.3 using pip:

python3 -m pip install arrow delegator
Collecting arrow
  Downloading https://mirrors.aliyun.com/pypi/packages/54/db/76459c4dd3561bbe682619a5c576ff30c42e37c2e01900ed30a501957150/arrow-0.10.0.tar.gz (86kB)
    100% |████████████████████████████████| 92kB 9.3MB/s
Collecting delegator
  Downloading https://mirrors.aliyun.com/pypi/packages/89/7f/a5103ebd2cf4e3ba10dbea3646ca12793a1040da654c98be125237363f33/delegator-0.0.3.tar.gz
Collecting python-dateutil (from arrow)
  Downloading https://mirrors.aliyun.com/pypi/packages/4b/0d/7ed381ab4fe80b8ebf34411d14f253e1cf3e56e2820ffa1d8844b23859a2/python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 21.9MB/s
Collecting six>=1.5 (from python-dateutil->arrow)
  Downloading https://mirrors.aliyun.com/pypi/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, arrow, delegator
  Running setup.py install for arrow ... done
  Running setup.py install for delegator ... done
Successfully installed arrow-0.10.0 delegator-0.0.3 python-dateutil-2.6.1 six-1.11.0 

but installed delegator module has no attribute:

>>> import delegator
>>> type(delegator)
<class 'module'>
>>> delegator.run('ls')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    delegator.run('ls')
AttributeError: module 'delegator' has no attribute 'run'
>>> dir(delegator)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']

I wonder if there is problem of my Python version or delagator?

nateprewitt commented 7 years ago

@leafonsword it looks like you're confusing delegator and delegator.py for installation. You need to pip install delegator.py to get the correct package.