According to the README, I executed the following command
sudo apt-get install protobuf-compiler libprotoc-dev
sudo pip install onnx
But returned error,installation failed
Command output:
`The directory '/home/bainuo/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/bainuo/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting onnx
/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading onnx-1.0.1.tar.gz (763kB)
100% |████████████████████████████████| 768kB 72kB/s
Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from onnx)
Requirement already satisfied: protobuf in /usr/local/lib/python2.7/dist-packages (from onnx)
Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages (from onnx)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/dist-packages (from protobuf->onnx)
Installing collected packages: onnx
Running setup.py install for onnx ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-UqC_cA/onnx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VUKlfT-record/install-record.txt --single-version-externally-managed --compile:
fatal: Not a git repository (or any of the parent directories): .git
running install
running build
running build_py
running create_version
running build_proto
running build_proto_in
compiling .in.proto
Processing /tmp/pip-build-UqC_cA/onnx/onnx/onnx.in.proto
Writing /tmp/pip-build-UqC_cA/onnx/onnx/onnx.proto
Writing /tmp/pip-build-UqC_cA/onnx/onnx/onnx.proto3
Writing /tmp/pip-build-UqC_cA/onnx/onnx/onnx-ml.proto
Writing /tmp/pip-build-UqC_cA/onnx/onnx/onnx-ml.proto3
Processing /tmp/pip-build-UqC_cA/onnx/onnx/onnx-operators.in.proto
Writing /tmp/pip-build-UqC_cA/onnx/onnx/onnx-operators.proto
Writing /tmp/pip-build-UqC_cA/onnx/onnx/onnx-operators.proto3
Writing /tmp/pip-build-UqC_cA/onnx/onnx/onnx-operators-ml.proto
Writing /tmp/pip-build-UqC_cA/onnx/onnx/onnx-operators-ml.proto3
compiling /tmp/pip-build-UqC_cA/onnx/onnx/onnx.proto
onnx.proto:383:5: Expected "required", "optional", or "repeated".
onnx.proto:383:17: Missing field number.
onnx.proto:402:3: Expected "required", "optional", or "repeated".
onnx.proto:402:15: Missing field number.
Traceback (most recent call last):
File "
File "/tmp/pip-build-UqC_cA/onnx/setup.py", line 438, in
'backend-test-tools = onnx.backend.test.cmd_tools:main',
File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/dist-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
self.run_command('build')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/tmp/pip-build-UqC_cA/onnx/setup.py", line 222, in run
self.run_command('build_proto')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/tmp/pip-build-UqC_cA/onnx/setup.py", line 187, in run
proto
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'/usr/bin/protoc', u'--proto_path', u'/tmp/pip-build-UqC_cA/onnx/onnx', u'--python_out', u'/tmp/pip-build-UqC_cA/onnx/onnx', u'--cpp_out', u'/tmp/pip-build-UqC_cA/onnx/onnx', u'/tmp/pip-build-UqC_cA/onnx/onnx/onnx.proto']' returned non-zero exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-UqC_cA/onnx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VUKlfT-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-UqC_cA/onnx/
`
What should I do to successfully install?
@bddppq
@zhangguangzhi Looks like it's protoc version being too old. Could you do protoc --version?
@bddppq the protoc version is 2.5.0,What version do I need?
@zhangguangzhi >=2.6.1
Thank you very much, the installation is complete.
I think we need to include the protoc version requirement in the README.
Most helpful comment
Thank you very much, the installation is complete.
I think we need to include the protoc version requirement in the README.