编辑使用Setuptools编译文件的位置
我正在使用setuptools使用Cython使用以下代码来编译PYX文件
from Cython.Distutils import build_ext
extensions=[Extension("filtering.filter", "filtering/filter.pyx")
setup(
name="..",
........
ext_modules=extensions,
cmdclass={"build_ext", build_ext}
include_dirs=[".", numpy.get_include()]
)
。 /代码> 运行PIP安装。
它正确地编译了文件,但将其存储在错误的位置,它将其存储在filtering/
而不是my_project/filtering/
我尝试使用setup.cfg
使用inplace = 1
,也尝试了build> build_lib =。
。放置 任何帮助都赞赏
I am using setuptools to compile a pyx file using Cython using the following code in my setup.py
from Cython.Distutils import build_ext
extensions=[Extension("filtering.filter", "filtering/filter.pyx")
setup(
name="..",
........
ext_modules=extensions,
cmdclass={"build_ext", build_ext}
include_dirs=[".", numpy.get_include()]
)
I want to use pip install .
to install this rather than python setup.py ...
When running pip install .
it compiles the file correctly, but stores it in the wrong place, it stores it in filtering/
rather than my_project/filtering/
I have tried using a setup.cfg
with inplace=1
and also tried build_lib=.
but this does not put it in the correct place either
Any help appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我正在编写一个软件包,其中所有代码都在
src
目录中,此方法对我来说很好。软件包结构
setup.cfg
setup.py
我不确定
.cfg
文件的最后一部分是否是文件(其中...)严格必要。I'm writing a package in which all the code goes inside the
src
directory, and this approach works fine for me.Package structure
setup.cfg
setup.py
I'm not sure if the last part of the
.cfg
file (where ...) is strictly necessary.