0

How do you write a setup.py to compile .pyx files in an arbitrary location and install the compiled code in another arbitrary location? For example dirA/spam.pyx to build/dirB/spam.so?

2

1 Answer 1

2

According to the distutils documentation, you can build any compiled python modules in an arbitrary location using the command line option --build-base, e.g.:

python setup.py build --build-base=/build/dirB

If you want to keep the default build directory, but install to a custom location, you should use one of the options --user --home, --prefix, --exec-prefix, --install-base or --install-platbase

Finally, if you just want the .so file in the current directory, use the option --inplace

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.