onnxruntime: error: package directory 'onnxruntime/backend' does not exist

===========================================================================
=>> Recording filesystem state for prestage... done
=======================<phase: stage          >============================
===>  Staging for py36-onnxruntime-0.5.1.20191030
===>   py36-onnxruntime-0.5.1.20191030 depends on package: py36-numpy>0 - found
===>   py36-onnxruntime-0.5.1.20191030 depends on package: py36-six>0 - found
===>   py36-onnxruntime-0.5.1.20191030 depends on package: py36-setuptools>0 - found
===>   py36-onnxruntime-0.5.1.20191030 depends on file: /usr/local/bin/python3.6 - found
===>   Generating temporary packing list
running install
running build
running build_py
creating build/lib
creating build/lib/onnxruntime
copying onnxruntime/__init__.py -> build/lib/onnxruntime
error: package directory 'onnxruntime/backend' does not exist
*** Error code 1

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

FWIW following command worked for me ./build.sh --config Release --build_shared_lib --parallel --enable_pybind --skip_tests --build_wheel --update --build This should generate whl file in the build directory (build/Linux/Release/dist) which can be installed using: pip install onnxruntime-1.7.0-cp38-cp38-linux_x86_64.whl

Oh, I see.

./build.sh --config RelWithDebInfo --build_shared_lib --parallel

Doesn’t satisfy your needs.

Please append ‘–enable_pybind’ to that.

Then, when the script is finished, please run setup.py in the build dir. (e.g. ~/onnxruntime/build/Linux/Debug)

–enable_pybind : Enable Python Bindings –build_wheel: Build Python Wheel.

–build_wheel implies --enable_pybind.

If you specified --build_wheel, then you don’t need to run setup.py manually.

I can successfully run it, if the build.sh exit with 0.

[root@fbtest ~/onnxruntime/build/Linux/Debug]# python3.6 ../../../setup.py bdist_wheel
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/onnxruntime
copying onnxruntime/__init__.py -> build/lib/onnxruntime
creating build/lib/onnxruntime/backend
copying onnxruntime/backend/__init__.py -> build/lib/onnxruntime/backend
copying onnxruntime/backend/backend.py -> build/lib/onnxruntime/backend
copying onnxruntime/backend/backend_rep.py -> build/lib/onnxruntime/backend
creating build/lib/onnxruntime/capi
copying onnxruntime/capi/__init__.py -> build/lib/onnxruntime/capi
copying onnxruntime/capi/_ld_preload.py -> build/lib/onnxruntime/capi
copying onnxruntime/capi/_pybind_state.py -> build/lib/onnxruntime/capi
copying onnxruntime/capi/onnxruntime_validation.py -> build/lib/onnxruntime/capi
copying onnxruntime/capi/session.py -> build/lib/onnxruntime/capi
creating build/lib/onnxruntime/datasets
copying onnxruntime/datasets/__init__.py -> build/lib/onnxruntime/datasets
creating build/lib/onnxruntime/tools
copying onnxruntime/tools/__init__.py -> build/lib/onnxruntime/tools
copying onnxruntime/tools/onnxruntime_test.py -> build/lib/onnxruntime/tools
copying onnxruntime/datasets/mul_1.onnx -> build/lib/onnxruntime/datasets
copying onnxruntime/datasets/logreg_iris.onnx -> build/lib/onnxruntime/datasets
copying onnxruntime/datasets/sigmoid.onnx -> build/lib/onnxruntime/datasets
copying onnxruntime/LICENSE -> build/lib/onnxruntime
copying onnxruntime/ThirdPartyNotices.txt -> build/lib/onnxruntime
copying onnxruntime/Privacy.md -> build/lib/onnxruntime
installing to build/bdist.freebsd-12.0-RELEASE-amd64/wheel
running install
running install_lib
creating build/bdist.freebsd-12.0-RELEASE-amd64
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime
copying build/lib/onnxruntime/__init__.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/backend
copying build/lib/onnxruntime/backend/__init__.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/backend
copying build/lib/onnxruntime/backend/backend.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/backend
copying build/lib/onnxruntime/backend/backend_rep.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/backend
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/capi
copying build/lib/onnxruntime/capi/__init__.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/capi
copying build/lib/onnxruntime/capi/_ld_preload.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/capi
copying build/lib/onnxruntime/capi/_pybind_state.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/capi
copying build/lib/onnxruntime/capi/onnxruntime_validation.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/capi
copying build/lib/onnxruntime/capi/session.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/capi
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/datasets
copying build/lib/onnxruntime/datasets/__init__.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/datasets
copying build/lib/onnxruntime/datasets/mul_1.onnx -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/datasets
copying build/lib/onnxruntime/datasets/logreg_iris.onnx -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/datasets
copying build/lib/onnxruntime/datasets/sigmoid.onnx -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/datasets
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/tools
copying build/lib/onnxruntime/tools/__init__.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/tools
copying build/lib/onnxruntime/tools/onnxruntime_test.py -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime/tools
copying build/lib/onnxruntime/LICENSE -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime
copying build/lib/onnxruntime/ThirdPartyNotices.txt -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime
copying build/lib/onnxruntime/Privacy.md -> build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime
running install_egg_info
running egg_info
creating onnxruntime.egg-info
writing onnxruntime.egg-info/PKG-INFO
writing dependency_links to onnxruntime.egg-info/dependency_links.txt
writing entry points to onnxruntime.egg-info/entry_points.txt
writing requirements to onnxruntime.egg-info/requires.txt
writing top-level names to onnxruntime.egg-info/top_level.txt
writing manifest file 'onnxruntime.egg-info/SOURCES.txt'
reading manifest file 'onnxruntime.egg-info/SOURCES.txt'
writing manifest file 'onnxruntime.egg-info/SOURCES.txt'
Copying onnxruntime.egg-info to build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.data/purelib/onnxruntime-1.0.0-py3.6.egg-info
running install_scripts
creating build/bdist.freebsd-12.0-RELEASE-amd64/wheel/onnxruntime-1.0.0.dist-info/WHEEL
creating 'dist/onnxruntime-1.0.0-cp36-cp36m-freebsd_12_0_RELEASE_amd64.whl' and adding 'build/bdist.freebsd-12.0-RELEASE-amd64/wheel' to it
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/LICENSE'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/Privacy.md'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/ThirdPartyNotices.txt'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/__init__.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/backend/__init__.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/backend/backend.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/backend/backend_rep.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/capi/__init__.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/capi/_ld_preload.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/capi/_pybind_state.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/capi/onnxruntime_validation.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/capi/session.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/datasets/__init__.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/datasets/logreg_iris.onnx'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/datasets/mul_1.onnx'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/datasets/sigmoid.onnx'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/tools/__init__.py'
adding 'onnxruntime-1.0.0.data/purelib/onnxruntime/tools/onnxruntime_test.py'
adding 'onnxruntime-1.0.0.dist-info/METADATA'
adding 'onnxruntime-1.0.0.dist-info/WHEEL'
adding 'onnxruntime-1.0.0.dist-info/entry_points.txt'
adding 'onnxruntime-1.0.0.dist-info/top_level.txt'
adding 'onnxruntime-1.0.0.dist-info/RECORD'
removing build/bdist.freebsd-12.0-RELEASE-amd64/wheel

This also happens when I first ruin cmake and then make:

===>  Staging for py36-onnxruntime-0.5.1.20191030
===>   py36-onnxruntime-0.5.1.20191030 depends on package: py36-numpy>0 - found
===>   py36-onnxruntime-0.5.1.20191030 depends on package: py36-six>0 - found
===>   py36-onnxruntime-0.5.1.20191030 depends on package: py36-setuptools>0 - found
===>   py36-onnxruntime-0.5.1.20191030 depends on file: /usr/local/bin/python3.6 - found
===>   Generating temporary packing list
running install
running build
running build_py
error: package directory 'onnxruntime/backend' does not exist

There were previously bugs that dealt with the same problem: https://github.com/microsoft/onnxruntime/issues/1737 https://github.com/microsoft/onnxruntime/issues/1453 Also other people had the same problem https://www.gitmemory.com/issue/microsoft/onnxruntime/1229/503739646 So this looks like a legitimate problem.