On 2013-W40-3, at 19:15, "Gisle Vanem" <gva...@yahoo.no> wrote:
> "Michael Schwarz" <michi.schw...@gmail.com> wrote: > >> So how do I run my code so it will find the built extension module? Do I >> pass the output directory on the command line manually or is there some >> other solution? I would like to still be able to run the code from the >> source directory as I'm using PyCharm to edit and debug the code. > > Doesn't Python on Linux (I assume that since you mentioned the module's .so) > support having current-dir '.' in $PYTHONPATH? Works fine on Windows. I'm running OS X 10.8 and Python 3.2, sorry I didn't mention it. But I assume the differences to Linux are minimal. The current directory is included in sys.path, otherwise I wouldn't be able to import modules in the same directory. But the problem is that the built extension module is in a subdirectory of the "build" directory: $ find -name '*.so' ./build/lib.macosx-10.8-x86_64-3.2/_foo.so And so I can't import it without manually adding that directory to sys.path. I'm convinced, someone on this list can shout at me, telling me that I got it completely backwards and that there's a straightforward and intuitive way to develop extension modules! Michael
smime.p7s
Description: S/MIME cryptographic signature
-- https://mail.python.org/mailman/listinfo/python-list