Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Python extension to specific location

My project mix pure Python code, and Cython extensions for optimization and for linking with C libraries. I have one source tree for my Python project, and one for Cython and C code. My Cython extensions each have a setup.py file to build them. Actually, for each extension, I do the following:

python setup.py build_ext --inplace
mv myext.so ../some/specific/place/

Is there a way to specify to distutils where to install my extension (if possible, using a relative path), instead of using --inplace followed by mv? Using --prefix option isn't good, since it creates a hierarchy of folders I don't need.

like image 786
Charles Brunet Avatar asked Jun 15 '11 18:06

Charles Brunet


1 Answers

I finally found the answer! The option is -b (or --build_lib)

python setup.py build_ext -b ../some/specific/place/
like image 60
Charles Brunet Avatar answered Oct 03 '22 02:10

Charles Brunet