1

I have installed package envoy. I ran the script but a windows error occured .I commented envoy.run then the full script runs but when I remove the comment, error occurs.

 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

traceback of script:

 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
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
pramod24
  • 1,096
  • 4
  • 17
  • 38
  • You need to provide the full path to "enron.mbox.json.bz2", something like `f = 'C:/path/to/resources/ch06-mailboxes/data/enron.mbox.json.bz2'` – Burhan Khalid Mar 05 '14 at 08:44
  • i also put the full path but same error occured – pramod24 Mar 05 '14 at 08:45
  • You also need to pull the full path to `bunzip2`. – Burhan Khalid Mar 05 '14 at 08:46
  • i am trying to install bunzip2 packege but it doesn't install.does not understand how to instal bunzip2 – pramod24 Mar 05 '14 at 08:52
  • You need to first download and install [`bzip2`](http://gnuwin32.sourceforge.net/packages/bzip2.htm) which will give you the archive utility. – Burhan Khalid Mar 05 '14 at 09:06
  • install bzip2 but same error occure.i think problem in envoy package. i am trying in python shell only enyoy command that is import envoy r=envoy.run('uptime') then same error occure – pramod24 Mar 05 '14 at 09:43

1 Answers1

0

Please try this:

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

vikas
  • 1,116
  • 1
  • 11
  • 12