2014-03-05 17 views
1

我已經安裝包envoy。我運行腳本,但發生了Windows錯誤。我評論envoy.run然後完整的腳本運行,但是當我刪除評論時,發生錯誤。腳本的如何在python中使用envoy包?

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 
+0

您需要提供完整路徑 「enron.mbox.json.bz2」,有點像'f ='C:/ path/to/resources/ch06-mailboxes/data/enron.mbox.json.bz2'' –

+0

我也放了完整路徑,但出現同樣的錯誤 – pramod24

+0

您還需要拉滿到'bunzip2'的路徑。 –

回答

0

請試試這個:

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

相關問題