How to change distutils' output directory?

1711 views python

When using python build with this code:

import setuptools
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules=cythonize("module1.pyx", build_dir="temp"))

the .pyd library is produced in .\build\\module1.pyd.

How to make the output .pyd file to the current folder . instead?

Note: the cythonize parameter build_dir="temp" works: the module1.c file produced by cython is in temp\ indeed. My question is about the output .pyd file.

answered question

1 Answer


Use the argument --dist-dir=[default: dist] option.

  --dist-dir (-d)   directory to put the source distribution archive(s) in
                    [default: dist]

Read more about packaging here.

posted this

Have an answer?


Please login first before posting an answer.