python - What option do I need in setup.py to create the package in the right directory? -
i using setup.py
create python package, want install via pip
. correctly install files under
lib/python2.7/site-packages/<package-name>
i used following option in setup.py
:
'package_dir': {'':'lib'}
as described here error
error: package directory 'lib' not exist
well, there no such directory want current directory installed package lib
or whatever. tried use
'package_dir': {'mycode':''}
which installes code directly in
lib/python2.7/site-packages/
and not under
lib/python2.7/site-packages/<package-name>
what doing wrong, , documented? might overlooked documentation of basic feature documentation setup.py
'suboptimal'.
the description how found in distribute documentation... within directory containing of project (towelstuff/
in given example) specify name of actual module (towelstuff/
). include your module need add following line in setup.py
:
'packages': ['towelstuff']
after having created sdist (from within towelstuff/
), installation of package install under site-packages/towelstuff
, can imported usual (from towelstuff import ...
).
Comments
Post a Comment