Question

I am new to lots of things.

I try to have Whoosh installed to look into the source code and play with it.

I add the path to folder containing setup.py and README.txt in sys.path, then

import setup

and error is displayed:

Traceback (most recent call last):
  File "C:/Users/Claire/Documents/Python_projects/Python_Open_Source/Whoosh1.py", line    6, in <module>
    import setup
  File "C:\Users\Claire\Documents\Python_projects\Python_Open_Source\Whoosh-     2.3.2\setup.py", line 20, in <module>
    long_description = open("README.txt").read(),
 IOError: [Errno 2] No such file or directory: 'README.txt'

when reaching this line in setup.py file:

long_description = open("README.txt").read(),

although sys.path entails the path to folder

C:\Users\Claire\Documents\Python_projects\Python_Open_Source\Whoosh-2.3.2\

Where does it come from, how to fix it?

Maybe I can only open a file in the path at the last position in sys.path?

Thanks and regards.

Was it helpful?

Solution

To install a new package into your python install you need to log into the package's directory and actually run the setup.py command. In your case, something like:

cd C:\Users\Claire\Documents\Python_projects\Python_Open_Source\Whoosh-2.3.2\

python ./setup.py build
python ./setup.py install

This should install the Whoosh modules into your python environment and make them available for import. This its just a matter of using the components withint he Woosh package as per their documentation here: http://packages.python.org/Whoosh/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top