Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing with pip : error: metadata-generation-failed #226

Open
DamienKoala opened this issue Nov 12, 2023 · 6 comments
Open

Error installing with pip : error: metadata-generation-failed #226

DamienKoala opened this issue Nov 12, 2023 · 6 comments

Comments

@DamienKoala
Copy link

Hello,

Describe the bug
On a RPI, I'am trying to install pybgs with pip3 install pybgs==3.1.0.post0
The follow error message appears :

        _File "/usr/local/lib/python3.12/ctypes/__init__.py", line 8, in <module>
          from _ctypes import Union, Structure, Array
      ModuleNotFoundError: No module named '_ctypes'_

note: This is an issue with the package mentioned above, not pip.

I'have install libffi-dev as suggest here.

To Reproduce
pip3 command as above

System information

Python3.12
Operating System: Raspbian GNU/Linux 10 (buster)

Additional context
It works on my Mint 19 and Python3.7... really no idea

Thanks for reading me !
Damien

@andrewssobral
Copy link
Owner

Hello @DamienKoala,

Thank you for bringing this issue to our attention. I suspect the problem may be related to the Python version. I haven't had the opportunity to test it with Python 3.12 yet. However, it should function correctly with Python versions 3.7, 3.8, 3.9, and 3.10.

If you have any further questions or need assistance, please feel free to reach out.

@DamienKoala
Copy link
Author

Well, I tried with python3.10 and a have the same error when installing... numpy !
So, It's probably a bug from RaspiOS, not you're library...
I suggest to close

@DamienKoala
Copy link
Author

Hi,
I've tried with a new raspiOS, and a Python11 version preinstalled.

The following message appears :
DEPRECATION: pybgs is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
After installing the wheel package, this appends :

  Running setup.py clean for pybgs
Failed to build pybgs

and
SetuptoolsDeprecationWarning: setup.py install is deprecated.

It seems to be a setup.py problem :

The solution should be with new package format (file.toml) :
https://packaging.python.org/en/latest/tutorials/packaging-projects

Regards,

@andrewssobral
Copy link
Owner

Thank you very much @DamienKoala , i need to check this when I have time.
Best regards,
Andrews

@DamienKoala
Copy link
Author

Building from source in a venv has also trouble : doesn't find opencv (i've install ine that venv CV with

pip install opencv-python

@andrewssobral
Copy link
Owner

@DamienKoala can you try again? i just generated a new version of the pybgs and it was tested successfully on Python 3.8, 3.9, 3.10, 3.11 and 3.12

My script below:

# You can use this docker image as reference: andrewssobral/opencv4:4.9.0py310
# https://github.com/andrewssobral/docker/blob/master/opencv4/4.9.0/Dockerfile.py310
# It contains the OpenCV built from source.
# Base image:
# https://github.com/andrewssobral/docker/blob/master/opencv4/Dockerfile.base_ubuntu22.04
# Then:

# Upgrade pip and install required packages numpy and OpenCV
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install numpy
python -m pip install opencv-python

python -m pip install pybgs

It should install the latest version (pybgs-3.3.0.post2)

Outputs below:

$ docker run -it --rm -w /opt/ andrewssobral/opencv4:4.9.0py310 bash
root@54d426e33a28:/opt# pip install pybgs
Collecting pybgs
  Downloading pybgs-3.3.0.post2.tar.gz (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 27.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pybgs
  Building wheel for pybgs (setup.py) ... done
  Created wheel for pybgs: filename=pybgs-3.3.0.post2-cp310-cp310-linux_x86_64.whl size=334628 sha256=596b02e24797f56c782c6b04ba0d2a88de3e3b99f8b9872549151eba4eeb55e9
  Stored in directory: /root/.cache/pip/wheels/6d/12/a2/02e5aec0ddc7e787c77f837c35663ff70d8307f29767b61852
Successfully built pybgs
Installing collected packages: pybgs
Successfully installed pybgs-3.3.0.post2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@54d426e33a28:/opt# pip list
Package     Version
----------- -----------
dbus-python 1.2.18
numpy       1.21.5
pip         22.0.2
pybgs       3.3.0.post2
PyGObject   3.42.1
setuptools  59.6.0
wheel       0.37.1
root@54d426e33a28:/opt# pip -V
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
root@54d426e33a28:/opt#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants