A novice question

21 views
Skip to first unread message

Nadav Horesh

unread,
Apr 22, 2012, 10:39:10 AM4/22/12
to cython...@googlegroups.com
Sorry for that simple question, but I could not find an answer find an answer for few days:

I made a package A that contains, among other things B.pyx and B.pxd. I have a setup.py which compiles and installs everything in
/usr/lib64/python-2.7/site-packages/A (this directory now contains B.so and B.pxd).
Now I have an cython code which is a part of an application, say  C.pyx, that requires B.pxd, but I can not get it to work properly, usually I get ImportError in C not able to find B (C.pyx requires B.pxd but not B.so).

My question is, what is the proper way (using setup.py) to cimport B? My plan is to use version 0.16 as its template engine is crucial for the project.

Thank you,

    Nadav

mark florisson

unread,
Apr 25, 2012, 10:54:16 AM4/25/12
to cython...@googlegroups.com
You need to inform Cython about the location your pxd is in, which you
can do by passing the -I/path/to/pxds command line flag to Cython, or
by passing in cython_include_dirs=['/path/to/pxds'] to Cython's
Extension for distutils in setup.py.

Nadav Horesh

unread,
Apr 29, 2012, 9:53:38 AM4/29/12
to cython...@googlegroups.com
Thanks, I think that eventually my problem was different. I'll back after finding out what the real problem is.

  Nadav.

2012/4/25 mark florisson <markflo...@gmail.com>
Reply all
Reply to author
Forward
0 new messages