如何在python中使用envoy包?

时间:2014-03-05 07:21:13

标签: python-2.7 jupyter-notebook python-envoy

我已经安装了包envoy。我运行了脚本,但发生了一个Windows错误。我评论了envoy.run,然后运行完整的脚本,但是当我删除注释时,会发生错误。

 import envoy

 # This data is checked-in to the repository and is a compressed 
 # version of the output from Example 3

 F = 'resources/ch06-mailboxes/data/enron.mbox.json.bz2'

 r = envoy.run("bunzip2 %s" % (F,))
 print r.std_out
 print r.std_err

脚本追溯:

 Exception in thread Thread-9:
Traceback (most recent call last):
 File "C:\Users\sachin\Anaconda\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Users\sachin\Anaconda\lib\threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\sachin\Anaconda\lib\site-packages\envoy\core.py", line 40, in target
bufsize=0,
File "C:\Users\sachin\Anaconda\lib\subprocess.py", line 709, in __init__
errread, errwrite)
File "C:\Users\sachin\Anaconda\lib\subprocess.py", line 957, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

1 个答案:

答案 0 :(得分:0)

请试试这个:

F = os.path.join(os.getcwd(), 'resources/ch06-mailboxes/data/enron.mbox.json.bz2')