I have a test setup file, which I made for a simple "hello world" script. I have a package named mytest which has a function hello. Now, I have a very simple setup.py. Everything works fine, if I just run python setup.py install. But if I want to install lib into home folder (python setup.py install --home=/home/blah), the package is not available anymore (running import mytest in python gives me ImportError: No module named mytest).
Should I add pth-file manually into site-packages folder? I tried it (with contents /home/blah/lib/python, where my package is put) and importing mytest worked fine. Shouldn't it be done automatically? Or have I missed something?
EDIT:
output of install:
ago@dellbert:~/py/mytest-0.1$ python setup.py install --home=/home/ago/py/ running install running build running build_py copying src/mytest/mytest.py -> build/lib.linux-x86_64-2.6/mytest running build_scripts copying and adjusting src/main.py -> build/scripts-2.6 running install_lib copying build/lib.linux-x86_64-2.6/mytest/mytest.py -> /home/ago/py//lib/python/mytest byte-compiling /home/ago/py//lib/python/mytest/mytest.py to mytest.pyc running install_scripts copying build/scripts-2.6/main.py -> /home/ago/py//bin changing mode of /home/ago/py//bin/main.py to 755 running install_egg_info Removing /home/ago/py//lib/python/mytest-0.1.egg-info Writing /home/ago/py//lib/python/mytest-0.1.egg-info
and setup.py:
from distutils.core import setup
setup(name='mytest',
description='test',
author='Ago',
author_email='email',
version='0.1',
package_dir={'mytest': 'src/mytest'},
packages=['mytest'],
scripts=['src/main.py']
)
Folder structure:
-src:
-mytest:
__init__.py
mytest.py
main.py
setup.py
main.py is just an executable which imports mytest and calls function to print hello world. But I have tried to just run import mytest in python to see, whether lib is installed.
site-packageswith contents/home/ago/py/lib/python. But will, if anyone has a solution why my module/package isn't available withpython setup.py install, I'm still interested. Thanks!