Troubleshooting "no pyproject.toml or setup.py file found"

87 views
Skip to first unread message

Sonja Offwood-De Klerk

unread,
Aug 3, 2022, 4:57:43 AM8/3/22
to Protocol Buffers
I am trying to include the dependency to protobuf for python with no binary, and am packaging my library with a setup.py file. I am using the below code:

from setuptools import setup, find_packages 
setup( name='your package`, 
 version='0.1', 
 packages=find_packages(),
 install_requires=
 )

However it gives the error message "no pyproject.toml or setup.py file found". i have tried various versions/releases of protobif with the same error.

When I try to download it manually, I have to first go into the python folder before I can see the setup.py and I assume that extra step is what's causing the issue?

Would you be able to assist how I can go about installing the package with no binary to avoid this issue?

Kind regards,
Sonja

Sandy Zhang

unread,
Aug 3, 2022, 4:49:13 PM8/3/22
to Protocol Buffers
Hi Sonja,

Based on the install_requires documentation, it seems that the specified project is installed by pip. Instead of specifying the python tar.gz published on github, I think you should be able to specify based on our pypi release instead. Can you try install_requires=['protobuf>=3.17.3'] or equivalent for your version requirements and let me know if that works instead?

Sonja Offwood-De Klerk

unread,
Aug 4, 2022, 5:35:06 AM8/4/22
to Sandy Zhang, Protocol Buffers
Hi Sandy, 

Thank you so much for your reply.

So the problem I am facing is that I am trying to install protobuf with "no binary", so basically I am trying to do
"pip install protobuf --no-binary protobuf" which would work in a requirements.txt, however our library is packaged with setup.py. From some googling I came across this solution which indicates that the workaround is to download the python tar.gz in the install_requires. (I can't add the --no-binary flag in the the install-requires)

Does that make sense?

Maybe to give a bit more background as to why I am even trying to install protobuf with the --no-binary flag, because there may be an alternative solution to my issue - 

When trying to build my environment using your suggestion of install_requires=['protobuf>=3.17.3'] , I get the following error, which seems to be caused by a conflict in numpy versions being used in the build of protobuf vs my local requirements of numpy.

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject.


According to this solution which I found for the same error but using a different repo, the options are to 
  • upgrade numpy to >=1.20 (which I can't because I have dependencies with numpy<1.20) or 
  • to use "minimum supported numpy" version in pyproject.toml (which may be an option from the protobuf side?) 
  • or to install protobuf with the --no-binary tag (which is the one I am attempting)..
So I either need "minimum supported numpy" version in pyproject.toml of protobuf to be set, or to install protobuf with the --no-binary tag?

Hope you can assist.
Kind regards,
Sonja


--
You received this message because you are subscribed to a topic in the Google Groups "Protocol Buffers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/protobuf/cpTyexeJF1c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/da3dc2d3-555b-4112-8ff0-6ec683acb663n%40googlegroups.com.

Sandy Zhang

unread,
Aug 4, 2022, 3:45:53 PM8/4/22
to Sonja Offwood-De Klerk, Protocol Buffers
What else do you have in your install_requires? Protobuf shouldn't have a dependency on numpy, so could this be coming from something else? Protobuf uses setup.py instead of pyproject.toml and doesn't include numpy there. Looks like we previously had a few things in install_requires in 3.17 and below, but afaict these don't seem to use numpy transitively either.

If this still seems to be coming from protobuf, can you provide more information on where/how you are getting the "ValueError: numpy.ndarray size changed ..." error?
Reply all
Reply to author
Forward
0 new messages