4

I'm using Python 3.5 on Ubuntu 16.04 LTS.

I save my python files in /home/me/Python and I would like to use a .pth-file to make python search that directory, so I created custompaths.pth and entered /home/me/Python on line 1.

I've tried saving custompaths.pth in several different directories, all of which are in sys.path, but if I try to import a module (testmod.py) located in /home/me/Python I just get:

ImportError: No module named 'testmod'  

I have tried saving testmod.py in the same directories where I've tried custompaths.pth and then it imports just fine.

I have also tried different ways of entering the search path in custompaths.pth:

/home/me/Python/  
/home/me/Python  
home/me/Python  
home/me/Python/  
'/home/me/Python/'  

Am I missing something here?

rrauenza
  • 6,285
  • 4
  • 32
  • 57
vikalm
  • 41
  • 3

0 Answers0