OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.48k stars 2.18k forks source link

pip install doesnt work #769

Open alonsoir opened 1 year ago

alonsoir commented 1 year ago

Hi Moses, this is the stacktrace in osx 12.6

┌<▸> ~ └➤ pip install imageai --upgrade zsh: /usr/local/bin/pip: bad interpreter: /usr/local/opt/python@3.9/bin/python3.9: no such file or directory Collecting imageai Downloading imageai-2.1.6-py3-none-any.whl (160 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.9/160.9 kB 2.8 MB/s eta 0:00:00 Collecting pillow==7.0.0 Downloading Pillow-7.0.0.tar.gz (38.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.2/38.2 MB 45.0 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Collecting numpy==1.19.3 Downloading numpy-1.19.3.zip (7.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.3/7.3 MB 52.2 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [46 lines of output] Error in sitecustomize; set PYTHONVERBOSE for traceback: AssertionError:

:67: RuntimeWarning: NumPy 1.19.3 may not yet support Python 3.10. Running from numpy source directory. :480: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates Error in sitecustomize; set PYTHONVERBOSE for traceback: AssertionError: Processing numpy/random/_bounded_integers.pxd.in Processing numpy/random/_philox.pyx Traceback (most recent call last): File "/private/var/folders/0x/gmzly6vn2f7ggfk47bdcsbnc0000gn/T/pip-install-29h6ei6i/numpy_3856a8b54d7b484490728676ad49d049/tools/cythonize.py", line 59, in process_pyx from Cython.Compiler.Version import version as cython_version ModuleNotFoundError: No module named 'Cython' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/private/var/folders/0x/gmzly6vn2f7ggfk47bdcsbnc0000gn/T/pip-install-29h6ei6i/numpy_3856a8b54d7b484490728676ad49d049/tools/cythonize.py", line 235, in main() File "/private/var/folders/0x/gmzly6vn2f7ggfk47bdcsbnc0000gn/T/pip-install-29h6ei6i/numpy_3856a8b54d7b484490728676ad49d049/tools/cythonize.py", line 231, in main find_process_files(root_dir) File "/private/var/folders/0x/gmzly6vn2f7ggfk47bdcsbnc0000gn/T/pip-install-29h6ei6i/numpy_3856a8b54d7b484490728676ad49d049/tools/cythonize.py", line 222, in find_process_files process(root_dir, fromfile, tofile, function, hash_db) File "/private/var/folders/0x/gmzly6vn2f7ggfk47bdcsbnc0000gn/T/pip-install-29h6ei6i/numpy_3856a8b54d7b484490728676ad49d049/tools/cythonize.py", line 188, in process processor_function(fromfile, tofile) File "/private/var/folders/0x/gmzly6vn2f7ggfk47bdcsbnc0000gn/T/pip-install-29h6ei6i/numpy_3856a8b54d7b484490728676ad49d049/tools/cythonize.py", line 64, in process_pyx raise OSError('Cython needs to be installed in Python as a module') OSError: Cython needs to be installed in Python as a module Cythonizing sources Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in main() File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "/usr/local/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel self.run_setup() File "/usr/local/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 281, in run_setup super(_BuildMetaLegacyBackend, File "/usr/local/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 174, in run_setup exec(code, locals()) File "", line 508, in File "", line 488, in setup_package File "", line 285, in generate_cython RuntimeError: Running cythonize failed! [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. ┌<▪> ~ └➤
PeshkovMaxim commented 1 year ago

similarly, it is impossible to install it on suse, ubuntu, manjaro

tankxiaodi commented 1 year ago

It only works with the old version of Python, like 3.6.9. I'd suggest you install it in a python virtual environment.

alonsoir commented 1 year ago

I would like to leave it open to see if one day the framework is updated to python3. Python2 is deprecated and no longer receives security updates, which is more than enough reason for everyone to uninstall it from their computers and code maintainers to update their libraries.

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=python

mylylyl commented 1 year ago

Isn't python 3.10 suggested in README? Got the same error. Cython is installed.