Pip install onnx failed
See original GitHub issueBug Report
Is the issue related to model conversion?
No
Describe the bug
When install onnx by:
sudo apt-get install protobuf-compiler libprotoc-dev
pip install git+https://github.com/onnx/onnx.git
get error:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libprotobuf.a(arena.o): relocation R_X86_64_TPOFF32 against hidden symbol `_ZN6google8protobuf8internal9ArenaImpl13thread_cache_E' can not be used when making a shared object
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libprotobuf.a(common.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
Error log link (in mlflow CI): https://github.com/mlflow/mlflow/pull/4545/checks?check_run_id=3026228796#step:9:303
System information
- OS Platform and Distribution (e.g. Linux Ubuntu 16.04): Ubuntu 20.04.2 LTS
- ONNX version (e.g. 1.7): github master version
- Python version: CPython (3.6.13)
- GCC/Compiler version (if compiling from source): The C compiler identification is GNU 9.3.0, The CXX compiler identification is GNU 9.3.0
- CMake version: 3.20.5
- Protobuf version: 3.17.3, libprotobuf.a;-lpthread (version “3.6.1”)
- Visual Studio version (if applicable):
Reproduction instructions
- Describe the code to reproduce the behavior. Bash code
sudo apt-get install protobuf-compiler libprotoc-dev
pip install git+https://github.com/onnx/onnx.git
- Attach the ONNX model to the issue (where applicable)
Expected behavior
A clear and concise description of what you expected to happen.
Notes
Any additional information
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Failed to install onnx via pip · Issue #2734 - GitHub
Looks like you're using python 3.8, which is currently unsupported. Can you try with python 3.7? All reactions.
Read more >Errors when installing onnx with pip in Ubuntu 20.04
I'm trying to install onnx in a fresh Ubuntu 20.04 install, but I'm running into the error bellow. It seems that I need...
Read more >ERROR: Could not build wheels for onnx in Python | bobbyhadz
To solve the error "Could not build wheels for onnx", run the pip install --upgrade pip command to upgrade your pip version and...
Read more >error: could not build wheels for onnx, which is required to ...
pip install -e . will fail due to missing .pyd file (FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\jacky\AppData\Local\Temp\tmpba9gls20 ...
Read more >onnx - PyPI
Official Python packages. ONNX released packages are published in PyPi. pip install onnx. Weekly packages are published in test pypi to enable experimentation ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@WeichenXu123 back to your original question,
Instead of running
You should run
Then, most important
It fails to build for me on Ubuntu 22.04. But I ran
export CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
and it built