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

Mismatch Between python_requires and requirements.txt Constraints #122

Open
gboeer opened this issue Dec 10, 2024 · 5 comments
Open

Mismatch Between python_requires and requirements.txt Constraints #122

gboeer opened this issue Dec 10, 2024 · 5 comments

Comments

@gboeer
Copy link

gboeer commented Dec 10, 2024

Hi,

I believe there’s a potential mismatch between the python_requires specification in setup.py and the fixed package version specified in requirements.txt.

Here are the details:

In setup.py, the package specifies:

setuptools.setup(
    python_requires=">=3.6"
)

In requirements.txt, the following is specified:

# verified versions
onnxruntime==1.8.0

However, when using Python 3.10.15 (in my case):

python --version
Python 3.10.15

The lowest installable version of onnxruntime via pip install is 1.12.0, not 1.8.0.

This suggests that onnxruntime==1.8.0 is incompatible with Python 3.10. As a result, it becomes difficult to use this package as is on Python versions greater than 3.9, even though the python_requires specification claims support for Python versions >= 3.6.

Expected Behavior:

The python_requires and requirements.txt should align so that the package can be installed with Python versions that are officially supported.

Suggested Fix:

Update requirements.txt to include a compatible version range for onnxruntime that works with Python 3.10.

Alternatively, adjust python_requires in setup.py to reflect the actual supported Python versions based on dependency compatibility.

Additional Context:
This mismatch can create confusion for users who are trying to use the package on newer Python versions. Please let me know if I’m misunderstanding anything or if there are other considerations.

@Elstuhn
Copy link

Elstuhn commented Dec 12, 2024

Hey Gordon, if you are having troubles on installation, the below is the readme for installation quick start, it worked for me let me know if you have any problems!

git clone [email protected]:YuHengsss/YOLOV.git
cd YOLOV
conda create -n yolov python=3.7

conda activate yolov

pip install -r requirements.txt

pip3 install -v -e .

@gboeer
Copy link
Author

gboeer commented Dec 12, 2024

Thanks for your answer, I got it to install with python version 3.10., I wouldn't want to use an ancient version like 3.7, I mean even 3.8. is deprecated now in most packages.

Had to ship around some problems with YOLOX first though:
Megvii-BaseDetection/YOLOX#1814

I still think the issue is valid, since the main problem stated here is, that the setup files for this YOLOV are not valid, i.e. some of the fixed requirements are not available for newer python versions, but the setup.py states that anything above python 3.6. will work.

@onyekaokonji
Copy link

Hi @gboeer if i understand this thread, you got to installing with newer python versions by making the changes to the YOLOX github repo, as pointed in the issue you raised? but i'm not sure how it translated to enabling this installation. can you please explain more.

secondly, i'm using a M-series Mac and it seems I have to uninstall opencv-python and use opencv-python-headless as i keep getting an error from the former, if you use a similar device, did you get similar challenges?

i appreciate your response on these issues.

@gboeer
Copy link
Author

gboeer commented Feb 26, 2025

Hi @onyekaokonji,
indeed, I have installed and used YOLOV with Python version 3.10.15.
However, you don't need to make any changes to YOLOX for this but rather follow the steps I have described in the mentioned YOLOX issue.

In short:
When installing YOLOV, try not to use the documented pip install -e . but rather pip install -v -e . --no-build-isolation.
This solved the problem for me, that torch wasn't recognized during the install, even though it was installed correctly.

The ticket here is merely about the incorrect setup.py and requirements.txt contained in this repo, which won't work for newer python versions.

I am working in a headless server using docker images so I can't say anything about Mac related issues.
For the same reason, I am always working with opencv-python-headless and indeed, one will get all kinds of errors if both variants of opencv are installed side by side.

More often than not I will get an error like:
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
when working with python packages that rely on opencv.

In those cases, it usually helps to do
pip uninstall opencv-python, then pip uninstall opencv-python-headless and then pip install opencv-python-headless.
While it looks strange uninstalling and installing the headless version, it almost always fixed the problem for me.

@onyekaokonji
Copy link

onyekaokonji commented Feb 27, 2025

thank you @gboeer i eventually got it to install and run on Python 3.12 by removing the version specific numbers on onnx_runtime and trusting that the latest version will have some backward compatibility with the version they used in the repo.

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

No branches or pull requests

3 participants