protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.29k stars 15.45k forks source link

fatal error C1083: Cannot open include file: 'google/protobuf/port_def.inc': No such file or directory #10270

Closed gordeli closed 2 years ago

gordeli commented 2 years ago

What version of protobuf and what language are you using? Version: 4.21.2 Language: Python

What operating system (Linux, Windows, ...) and version? Windows 10 Entreprise Version 10.0.19044 Build 19044

What runtime / compiler are you using (e.g., python version or gcc version) Python 3.8.5

What did you do? Steps to reproduce the behavior:

  1. Followed the instructions from here: https://grpc.io/docs/protoc-installation/ 2.Downloaded, extracted, updated PATH protoc-21.2-win64.zip protobuf-python-4.21.2.zip
  2. run pip install protobuf
  3. protoc --version libprotoc 3.21.2
  4. run python setup.py build
  5. python setup.py install
  6. pip install gcld3
  7. See error

What did you expect to see

Successful installation

What did you see instead? See attached file:

cmd_output.txt

fowles commented 2 years ago

mark down is not having fun with your formatting. Can you put that in text document?

perezd commented 2 years ago

This appears to be using --cpp_out and not python protos: https://github.com/google/cld3/blob/3.0.13/setup.py#L67

perezd commented 2 years ago

Here, I believe this is fetching a protobuf runtime for pypi for the includes? https://github.com/google/cld3/blob/3.0.13/setup.py#L94

perezd commented 2 years ago

Looking at the failing command's includes, I don't see anywhere where the protobuf source would be included for use, which is why you are seeing this.

-Ic:\users\i_gordeliy\appdata\local\temp\pip-install-fqpy9gtz\gcld3_524423b12c494840b7cbef40c225f924\.eggs\pybind11-2.10.0-py3.8.egg\pybind11\include 
-IC:\Users\i_gordeliy\Anaconda3\envs\twitter\include 
-IC:\Users\i_gordeliy\Anaconda3\envs\twitter\Include 
"-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\include" 
"-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" 
"-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" 
"-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" 
"-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" 
"-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" 

It's stuggling here, post protoc generating C++ output and as it attempts to compile it w/ cl.exe:

  C:\Users\i_gordeliy\AppData\Local\Temp\pip-install-fqpy9gtz\gcld3_524423b12c494840b7cbef40c225f924\src\cld_3/protos/feature_extractor.pb.h(10): fatal error C1083: Cannot open include file: 'google/protobuf/port_def.inc': No such file or directory

I'd suggest opening an issue w/ the gld3 folks and ask them if they need to update the setup.py script to handle properly including Protobuf C++ source code to compile pybind_ext.cc. I don't think we can help you further here.

If things change, let us know!