[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Python modules not installed correctly with pycentral



On Mon, Jan 07, 2008 at 11:15:53AM +1100, Ben Finney wrote:
> The problem apparent when installing that .deb is that after
> installation the modules *only* exist in that pycentral path; they are
> never installed to the Python site-packages directory, and so the
> Python package can't be found by programs that try to import it.
> 
>     $ dpkg --install gracie_0.2.6-1_all.deb
>     Selecting previously deselected package gracie.
>     (Reading database ... 31561 files and directories currently installed.)
>     Unpacking gracie (from .../gracie_0.2.6-1_all.deb) ...
>     Setting up gracie (0.2.6-1) ...
>     Starting Gracie OpenID provider:Traceback (most recent call last):
>       File "/usr/bin/gracied", line 18, in ?
>         from gracie.server import become_daemon
>     ImportError: No module named gracie.server
>     invoke-rc.d: initscript gracie, action "start" failed.
>     dpkg: error processing gracie (--install):
>      subprocess post-installation script returned error exit status 1
>     Errors were encountered while processing:
>      gracie
> 
>     $ find /usr -name 'server.py' | grep gracie
>     /usr/share/pycentral/gracie/site-packages/gracie/server.py
> 
> 
> What am I missing? I was under the impression that it was pycentral's
> task, at install time, to install the modules from
> '/usr/share/pycentral/gracie/' to the appropriate place for Python to
> import them. That's not happening though.

I don't have bzr installed at the moment, so I don't have a way to pull
your source and check, but it sounds to me like something is missing
from your rules scripts: I would typically expect that you would have
some dh_foo rule that would generate a postinst which is called as part
of your package, and that that postinst would do the installing.

Since it appears you have a *different* postinst, it's possible that you
need something like a "#DEBHELPER#" snippet in your existing postinst to
allow debhelper to actually put the files in the right place: when I was
missing this in the past, I got similar behavior (where the postinst in
my package was run, but the python-support postinst wasn't).

These are just hints -- I only started using python-support about two
weeks ago, and I've never used pycentral. I'm sure others on the list
can contribute more effectively. However, I think that it would probably
be worthwhile to look into whether the postinst in your package is what
you expect it to be -- and that expectation should probably include an
expectation that there is some pycentral related task run in postinst. 

Good luck,
-- 
Christopher Schmidt
MetaCarta


Reply to: