开发者

getting dogtail example script to run on Ubuntu 10.04

I recently installed Dogtail, an open source GUI testing tool and automation framework. I downloaded the example script (https://fedorahosted.org/dogtail/browser/examples/gedit-test-utf8-tree-api.py?format=txt) to my computer, but am having trouble getting it work. When I invoke it, I get a message saying:

corey@corey-laptop:~/Desktop/exercise$ ./gedit-test-utf8-tree-api.py 
Tra开发者_开发技巧ceback (most recent call last):
  File "./gedit-test-utf8-tree-api.py", line 6, in <module>
    from dogtail import tree
  File "/home/joe/Desktop/exercise/dogtail.py", line 6, in <module>
    from dogtail import tree
ImportError: cannot import name tree

I'm using Ubuntu 10.04. I'm not sure why this won't run or how to fix it. Any ideas?


Don't name the file in /home/joe/Desktop/exercise dogtail:

  File "/home/joe/Desktop/exercise/dogtail.py", line 6, in <module>
    from dogtail import tree

Python is importing your dogtail.py instead of the package located at /usr/share/python-support/python-dogtail/dogtail.

To test this theory, you can open the python interpreter and type

import dogtail
dogtail.__file__

to see where dogtail is coming from.


From your traceback, it looks like you have not installed dogtail.

you are running from the directory ~/Desktop/exercise

The dogtail.py is in the same directory and it should have been a package called dogtail with a file tree.py . Is this dogtail.py writen by you or part of the dogtail framework?

Some thing is amiss here.


Mine worked when I installed dogtail at /usr/local rather than /usr run ./setup.py install --prefix=/usr/local

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜