2021年1月5日星期二

How can I install a .so file generated from CMake and import it in python?

I tried these lines of code here in setup.py:

from distutils.core import setup  setup (name = 'package_name',         version = '0.1',         author = "Nobody",         description = """Install precompiled extension""",         packages=[''],         package_data={'': ['path_to_package/package_name.so']},         )  

And running path/to/my/python -m pip install -e . will say the package is installed successfully. However I got module not found error when I tried to import the package.

So, is it possible to install .so in pip? If so, how should I modify the setup.py file?

Thanks in advance!

https://stackoverflow.com/questions/65587979/how-can-i-install-a-so-file-generated-from-cmake-and-import-it-in-python January 06, 2021 at 07:22AM

没有评论:

发表评论