Open ashutoshnaik opened 3 years ago
Hi @ashutoshnaik,
On some platforms with installed Python, PythonLibs from Cmake cannot find the right Python path. What's your environment?Could you try apt-get install python3-dev
before the ORT installation? Thank you.
Hi @jcwchen ,
I am using Ubuntu 20.04. I installed cmake 3.16.3 from sources.
python3-dev is already installed and is the latest version :
root@ash-Inspiron-3576:/home/ash# apt-get install python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-dev is already the newest version (3.8.2-0ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.
Do let me know if I need to reinstall everything, or how can I proceed ?
Thanks, Ashutosh Naik.
Some other things to try:
Use a virtual Python environment instead of the system Python, like conda or python3-venv. This has the additional benefit of not requiring or installing (which build.py automatically does in some cases) onnxruntime dependencies in your system Python installation. I didn't see this error when using a virtual environment on Ubuntu 20.04.
It is possible to manually set PYTHON_LIBRARY and PYTHON_INCLUDE_DIR (more info at https://cmake.org/cmake/help/latest/module/FindPythonLibs.html). You can give an additional argument to build.sh: --cmake_extra_defines PYTHON_LIBRARY=... PYTHON_INCLUDE_DIR=...
, see an example here: https://github.com/microsoft/onnxruntime/blob/5cf66069645d338b481e70dcfe869161c03e102f/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml#L42
And just to note, the --build_wheel
option implies --enable_pybind
.
It did work for me by setting additional argument to build.sh:
--cmake_extra_defines PYTHON_LIBRARY=... PYTHON_INCLUDE_DIR=...,
However, this could probably be solved in a better way ?
Hi,
I am unable to build onnxruntime with "--build_wheel" and "--enable_pybind" options. I have confirmed that I have python 3.8 installed and all the dependencies. It compiles perfectly without the above two options. Let me know if I am missing anything
Here is the log:
Thanks Ashutosh