November 30th, 2004, 05:06 PM
I'm writing a python script which needs to read a package from a directory currently not known by python. I've simply appended the path to the sys module, then called the module in question, but on running, the package fails to be found. Here's the code I'm using:
import nltk #package located in above appended directory
Any ideas where I'm going wrong???
December 1st, 2004, 04:52 AM
Permissions could be the problem.
When you say package do you mean module as in nltk.py
or that nltk is a sub-directory of /home/csunix/extras conforming to the Python package format (it has a __init__.py file).
December 1st, 2004, 04:46 PM
Sorted. I did not reference the correct sub-directory containing the _init_.py