From: <no...@so...> - 2002-11-29 10:15:50
|
Bugs item #645615, was opened at 2002-11-29 05:15 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=645615&group_id=12867 Category: Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Leif Johnson (lmjohns3) Assigned to: Nobody/Anonymous (nobody) Summary: cannot import through symbolic links Initial Comment: I am working on an i686 GNU/Linux system with Sun's JDK 1.4.1, Python 2.2.2, and Jython 2.1. I have written a Jython package that I wish to test before installing. The file structure is generally as follows : work/ + __init__.py + mysubpackage/ | + __init__.py | ` mysubmodule.py + otherdir1/ ` otherdir2/ (Sorry for the bad ASCII art ; I hope you can read the structure anyway.) I want to import the package rooted at "work" under the name "mypackage". The mypackage init script essentially just imports the underlying subpackage ; that is, work/__init__.py contains "from mysubpackage import *". Using CPython I can do the following : $ cd work $ ln -s . mypackage $ python Python 2.2.2 (#1, Nov 21 2002, 08:18:14) [GCC 2.95.4 20011002 (Debian prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mypackage >>> But if I try the same with jython, here is what I get : $ cd work $ ln -s . mypackage $ jython Jython 2.1 on java1.4.1 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import mypackage Traceback (innermost last): File "<console>", line 1, in ? ImportError: no module named mypackage >>> If, instead, I physically copy all the appropriate source files to a physical directory called "mypackage", then the import works fine with both standard Python and Jython. I hope this helps! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=645615&group_id=12867 |