So are we saying that this could be a bug with Pig?  It should work like this:

pig  -Dpyclasspath=

Just confirming before I send this to Pig user mailing list.  Thanks.

On Fri, Feb 15, 2013 at 10:15 AM, Johannes Buchner <buchner.johannes@gmx.at> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/15/2013 06:47 PM, Jeff Emanuel wrote:
>
> It will print the paths where it tries to find each imported
> module. You should see where it is looking for you file, and if you
> don't find it looking where you expect, change the import path
> until it does.

You could also just print out sys.path. Chances are pigs sets the
JYTHONPATH/PYTHONPATH without respecting the content of the
environment variable. If so, you should file a bug.

Cheers,
       Johannes

> On 2/15/2013 10:43 AM, Something Something wrote:
>> That was a cool trick, Jeff.  So I tried this:
>>
>> pig -Dpython.verbose=debug xyz.py
>>
>> and it's printing a huge log, which I will review, but anything
>> in particular I should look at.
>>
>> PS:  In case it's not obvious yet, I am a fairly newbie to
>> Python/Jython, so appreciate the patience :)
>>
>>
>> On Fri, Feb 15, 2013 at 9:23 AM, Jeff Emanuel <jemanuel@frii.com
>> <mailto:jemanuel@frii.com>> wrote:
>>
>> Can you set the jython verbose flag from your pig?  Set it to
>> comment or debug to get import tracing printout.
>>
>>
>> On 2/15/2013 9:52 AM, Something Something wrote:
>>> Hello,
>>>
>>> I am invoking Jython via Apache Pig like this:
>>>
>>> pig xyz.py
>>>
>>> (Which internally calls Jython)
>>>
>>> This is working fine in production for some time.  Now we want
>>> to separate all our 'py' files into different subdirectories.
>>> e.g.
>>>
>>> ./lib/Vehicle.py ./lib/cars/Toyota.py
>>>
>>> & so on.  You get the idea.
>>>
>>> Now when I added the following lines in my Vehicle.py
>>>
>>> from Toyota import Toyota
>>>
>>> It gives me ImportError:  No module named Toyota
>>>
>>>
>>> To fix this I tried changing JYTHONPATH in different ways -
>>> even hard coding the path - but it's not helping.  e.g.
>>>
>>> pig -DJYTHONPATH=/mypath/cars
>>>
>>>
>>> Please help.  Thanks.
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
Free Next-Gen Firewall Hardware Offer
>>> Buy your Sophos next-gen firewall before the end March 2013 and
>>> get the hardware for free! Learn more.
>>> http://p.sf.net/sfu/sophos-d2d-feb
>>>
>>>
>>> _______________________________________________ Jython-users
>>> mailing list Jython-users@lists.sourceforge.net
>>> <mailto:Jython-users@lists.sourceforge.net>
>>> https://lists.sourceforge.net/lists/listinfo/jython-users
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
Free Next-Gen Firewall Hardware Offer
>> Buy your Sophos next-gen firewall before the end March 2013 and
>> get the hardware for free! Learn more.
>> http://p.sf.net/sfu/sophos-d2d-feb
>>
>>
>> _______________________________________________ Jython-users
>> mailing list Jython-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jython-users
>
>
> ------------------------------------------------------------------------------
>
>
Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013 and get
> the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
>
>
>
> _______________________________________________ Jython-users
> mailing list Jython-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iEUEARECAAYFAlEeezYACgkQ7X1+MfqVcr1uYQCglS+yFc3Upbj0Je6nh7ZzpJG9
3LsAmO12eQ4cRcBht5IpG0OE66VhIAM=
=+OIe
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users