On Mon, Aug 31, 2009 at 1:15 PM, Zico <mailz...@gmail.com> wrote:

>
>
> On Mon, Aug 31, 2009 at 7:43 PM, Karen Tracey <kmtra...@gmail.com> wrote:
>
>> You seem to have been following the doc for downloading/installing
>> stdimage, which says to put it somewhere in a directory included in your
>> PYTHONPATH.  By putting it directly in site-packages you can do imports of
>> the form "from stdimage import StdImageField".
>>
>> What does it actually means?  *"The fixmystreet project is configured to
> look for these projects in a contrib directory on your python path."
>
> What does "python path" means actually??*
>

See http://docs.python.org/tutorial/modules.html#the-module-search-path for
the official doc on the module search path.  The "installation-dependent
default path" mentioned there will usually include the site-packages
directory, where you placed stdimage.

The problem is that fixmystreet isn't expecting these things to be directly
accessible on your python path, it's expecting them to be found under a
'contrib' package.  That is, instead of using:

from stdimage import StdImageField

fixmystreet uses:

from contrib.stdimage import StdImageField

So in searching for a match to fixmystreet's way of importing this support,
Python will be looking for a file <python install
dir>/site-packages/contrib/stdimage/__init__.py, which won't be found since
you've got it under <python install dir>/site-packages/stdimage/__init__.py.

Where you have placed it is good (I'd guess) for how most code dependent on
this package would use it.  Most packages (that I have run across) that are
dependent on other packages simply expect them to be available directly on
the python path.

The fixmystreet package seems to be the one that is doing things a bit
oddly.  I don't know what their install instructions mean when they say "You
may either change this configuration" -- I haven't dug into it in any detail
to see if there is really a way you can easily tell the package to import
these things directly instead of "from contrib.stdimage", e.g.  If there is
a way (other than going and changing the imports in their code) I'd use it.
If not, you'll need to make these dependencies accessible to fixmystreet
under a contrib directory.  Personally I'd probably put it under
/opt/fixmystreet rather than site-packages, and either link to the version
installed under site-packages or install another copy under
/opt/fixmystreet/contrib.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to