# Weird Python ImportError



## ppvora (Dec 20, 2013)

I'm running FreeBSD on a VPS where I'm also root. When I'm logged in as a regular user (not root) and I try to import the glob module it throws an ImportError.  However, I know it's installed in the /usr/local/lib/python2.7 directory.  Also, when I import is as root, there's no issue. The file permissions on the glob.py, glob.pyc, and glob.pyo files are identical to the other modules in that directory. 

What's going on? All help is highly appreciated.


----------



## funky (Dec 20, 2013)

Hi,

Maybe something is wrong with your Python module search path. You can print the search paths with a Python command line:

```
$ python
>>> import sys
>>> print sys.path
```
Check if the path to glob.py is listed there. If it is there, it is most likely a permission problem, if not you have two options: directly modify sys.path within python before you import glob, or set the $PYTHONPATH environment variable.


----------

