question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem installing onnx from source

See original GitHub issue

After installing onnx from binaries and encountering problems (missing functions) when running the Python API notebooks and after an advice to install from source, I have attempted several times to do so. Unfortunately, the installation check does not work.

Installation attempted on Windows 10 Pro host, VBox 5.2.18 virtual machine Ubuntu 18.04.

Below is exactly what I did (following the installation instructions) in my last attempt:

elena@elena-VirtualBox:~$ cd eStep/XAI/Software/
elena@elena-VirtualBox:~/eStep/XAI/Software$ conda update -n base -c defaults conda
elena@elena-VirtualBox:~/eStep/XAI/Software$ conda create --name onnx_elena
elena@elena-VirtualBox:~/eStep/XAI/Software$ source activate onnx_elena
(onnx_elena) elena@elena-VirtualBox:~/eStep/XAI/Software$ conda config --add channels conda-forge
(onnx_elena) elena@elena-VirtualBox:~/eStep/XAI/Software$ conda install -c conda-forge protobuf numpy
(onnx_elena) elena@elena-VirtualBox:~/eStep/XAI/Software$ git clone https://github.com/onnx/onnx.git
(onnx_elena) elena@elena-VirtualBox:~/eStep/XAI/Software$ cd onnx
(onnx_elena) elena@elena-VirtualBox:~/eStep/XAI/Software/onnx$ git submodule update --init --recursive
(onnx_elena) elena@elena-VirtualBox:~/eStep/XAI/Software/onnx$ python setup.py install
(onnx_elena) elena@elena-VirtualBox:~/eStep/XAI/Software/onnx$ cd onnx
(onnx_elena) elena@elena-VirtualBox:~/eStep/XAI/Software/onnx/onnx$ python -c "import onnx"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/elena/anaconda3/envs/onnx_elena/lib/python3.6/site-packages/onnx-1.2.2-py3.6-linux-x86_64.egg/onnx/__init__.py", line 11, in <module>
    import onnx.helper  # noqa
  File "/home/elena/anaconda3/envs/onnx_elena/lib/python3.6/site-packages/onnx-1.2.2-py3.6-linux-x86_64.egg/onnx/helper.py", line 13, in <module>
    import onnx.defs as defs
  File "/home/elena/anaconda3/envs/onnx_elena/lib/python3.6/site-packages/onnx-1.2.2-py3.6-linux-x86_64.egg/onnx/defs/__init__.py", line 7, in <module>
    import onnx.onnx_cpp2py_export.defs as C
ImportError: /home/elena/anaconda3/envs/onnx_elena/lib/python3.6/site-packages/onnx-1.2.2-py3.6-linux-x86_64.egg/onnx/onnx_cpp2py_export.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev

The same error appears no mater of the folder nor if inside python or not.

Please, advice!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
maxwillzqcommented, Mar 12, 2019

I have same problem after change to other folder

the error message is same

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/qzhang/Documents/OpenSource/onnx/onnx/__init__.py", line 14, in <module>
    import onnx.helper  # noqa
  File "/Users/qzhang/Documents/OpenSource/onnx/onnx/helper.py", line 13, in <module>
    import onnx.defs as defs
  File "/Users/qzhang/Documents/OpenSource/onnx/onnx/defs/__init__.py", line 7, in <module>
    import onnx.onnx_cpp2py_export.defs as C
ModuleNotFoundError: No module named 'onnx.onnx_cpp2py_export.defs'

Any suggestion ? I exactly follow the contribution guide page https://github.com/onnx/onnx/blob/master/docs/CONTRIBUTING.md

I use these command line to install it:

  642  git submodule update --init --recursive
  643  python setup.py install
1reaction
houseroadcommented, Aug 17, 2018

Since you are not using python setup.py develop, you probably should not enter the onnx folder to execute the command. Try to execute python -c “import onnx” in other folder?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation fail · Issue #133 · onnx/onnx - GitHub
I installed onnx via "pip install onnx" under Acaconda3, but got the following error messages. Could someone take a look? Many thanks.
Read more >
Errors when installing onnx with pip in Ubuntu 20.04
In summary, to install onnx successfully in Ubuntu 20.04, you'll need to: 1) Install protobuf-compiler: sudo apt install protobuf-compiler.
Read more >
Install ONNX Runtime | onnxruntime
Instructions to install ONNX Runtime on your target platform in your environment.
Read more >
onnx - PyPI
First, you need to install protobuf. The minimum Protobuf compiler (protoc) version required by ONNX is 3.0.0. Please note that old protoc versions...
Read more >
Issues while installing onnx==1.6.0 - NVIDIA Developer Forums
I'm trying too install 0nnx1.6.0 because TensorRT 7.1 doesn't support 0nnx1.7.0. I tried installing with pip & also building it from source.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found