5

I am one of the devs of a (fairly large) C++ simulation tool. Disclaimer : I'm more of a physicist than a dev. I wrote Python bindings for that project using pybind11.

I managed to get the Python module to compile with cmake. I then managed to write a setup.py file using skbuild that does compile the Python module :

python3 setup.py sdist bdist_wheel

In _skbuild/linux-x86_64-3.9/cmake-build/lib/ (and in the tar archive dist/cytosim-0.0.0.tar.gz) there is indeed a compiled library : cytosim.cpython-39-x86_64-linux-gnu.so.

However, when I want to install the module :

pip3 install dist

I get an error :

gcc: error: src/py3/dist.c: No such file or directory

I am very confused because I do not have an directory called py3 in src.

Any pointer ? Anything I'm doing wrong ? Thanks !

SergeD
  • 44
  • 9
  • 1
    Seems like it is the installation from the _sdist_ that fails. Is it possible to install the wheel without issue? – sinoroc Dec 09 '22 at 09:49
  • The wheel installs fine (yeah thanks!) - but still I would like to install the sdist because of portability. – SergeD Dec 09 '22 at 09:54

1 Answers1

4

The command

pip3 install dist

tries (and fails) to install the dist package from the pypi repository.

Maybe try

pip3 install dist/cytosim-0.0.0.tar.gz

instead.

unddoch
  • 5,790
  • 1
  • 24
  • 37
  • Yes, that seems spot on. Here is the `setup.py` of `dist` on _PyPI_: https://inspector.pypi.io/project/dist/1.0.3/packages/5c/2f/76760a4bf4fe7423c387eca4a8a8363fc74ee30cadb1a20ee8e38bc8a69f/dist-1.0.3.zip/dist-1.0.3%2Fsetup.py – sinoroc Dec 12 '22 at 13:34