I have created a virtualenv with python3. Inside the vitual environment, I have 2 proto files in my folder along with nanopb package. The structure is
.
├── api.pb
├── api.proto
├── bin
├── compile.sh
├── include
├── lib
├── nanopb-0.4.2-linux-x86
└── types.proto
As first step i compiled types.proto and api.proto into api.pb using the command
./nanopb-0.4.2-linux-x86/generator-bin/protoc -I=./nanopb-0.4.2-linux-x86/generator/proto -I=. api.proto -o api.pb
Once the pb file is generated I executed the following command,
python nanopb-0.4.2-linux-x86/generator/nanopb_generator.py /home/ankit/Desktop/api/venv-proto-3/api.pb
which gives the following error
(venv-proto-3) ankit@ankit-desktop:~/.../api/venv-proto-3$ python nanopb-0.4.2-linux-x86/generator/nanopb_generator.py /home/ankit/Desktop/api/venv-proto-3/api.pb
Writing to api.pb.h and api.pb.c
Traceback (most recent call last):
File "nanopb-0.4.2-linux-x86/generator/nanopb_generator.py", line 2122, in <module>
main_cli()
File "nanopb-0.4.2-linux-x86/generator/nanopb_generator.py", line 2034, in main_cli
os.makedirs(os.path.dirname(path), exist_ok=True)
File "/home/ankit/Desktop/api/venv-proto-3/lib/python3.5/os.py", line 241, in makedirs
mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''
(venv-proto-3) ankit@ankit-desktop:~/.../api/venv-proto-3$
Any idea what I am doing wrong here. Pretty new to protobuf.
Thanks