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

editable mode installation problem with UNKNOWN built #12819

Closed
1 of 2 tasks
Boatsure opened this issue May 19, 2024 · 4 comments
Closed
1 of 2 tasks

editable mode installation problem with UNKNOWN built #12819

Boatsure opened this issue May 19, 2024 · 4 comments
Labels
bug Something isn't working non-reproducible Bug is not reproducible

Comments

@Boatsure
Copy link

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Install

Bug

My development platform is NVIDIA Jetson TX2, yes it is old, and all componets are based on python3.6. To use yolov8-2 in the TX2, I have upgraded the torch to 1.8 version.

I pull the ultralytics as suggested:
git clone https://github.com/ultralytics/ultralytics cd ultralytics
and I want to make modification to yolov8-2, so I Install the package in editable mode for development:
pip install -e .
But the terminal reports as follows:

ERROR: Project file:///home/nvidia/yolov8-2 has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.

I search the previous issue #9832
but upgrading pip is not useful, and more importantly, when I install with pip install ., outputs are as follows:

Processing /home/nvidia/yolov8-2
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
Building wheel for UNKNOWN (pyproject.toml) ... done
Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=12921 sha256=f861cecae0dbdb1e020c54a454ee96ac8d046dd38a0836eaa49daf06bf05a5f1
Stored in directory: /home/nvidia/.cache/pip/wheels/86/ec/e6/a83d3c62e80135ff7dc838cfe27090052fabb3388621f26a60
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
Attempting uninstall: UNKNOWN
Found existing installation: UNKNOWN 0.0.0
Uninstalling UNKNOWN-0.0.0:
Successfully uninstalled UNKNOWN-0.0.0
Successfully installed UNKNOWN-0.0.0

And of course the installation is failed.
What's the possible reason for that please?

Environment

Ultralytics YOLOv8.1.9 🚀 Python-3.6.9 torch-1.8.0 CUDA:0 (NVIDIA Tegra X2, 7852MiB)
Setup complete ✅ (6 CPUs, 7.7 GB RAM, 20.8/27.4 GB disk)

Minimal Reproducible Example

As the suggested installation procedures:

# Clone the ultralytics repository
git clone https://github.com/ultralytics/ultralytics
# Navigate to the cloned directory
cd ultralytics
# Install the package in editable mode for development
pip install -e .

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@Boatsure Boatsure added the bug Something isn't working label May 19, 2024
Copy link

👋 Hello @Boatsure, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

Hi there! It seems like you're encountering an issue with installing YOLOv8 in editable mode due to the lack of a setup.py file, which is required for editable installations with older versions of pip that don't support PEP 660.

Here are a couple of suggestions to resolve this:

  1. Upgrade pip and setuptools to the latest versions, as they include support for PEP 660 which allows editable installs without a setup.py:

    pip install --upgrade pip setuptools
  2. If upgrading doesn't resolve the issue, consider manually adding a setup.py to your project as a workaround. Here's a basic template you can use:

    from setuptools import setup, find_packages
    
    setup(
        name="your_package_name",
        version="0.1.0",
        packages=find_packages(),
    )

    Place this in your project root and try the editable installation again.

  3. Check for any environment-specific issues with Python or dependency conflicts that might be causing the installation to register as "UNKNOWN". Sometimes, cleaning the pip cache can help:

    pip cache purge
  4. Re-clone the repository to ensure there are no corrupted files or missing components:

    cd ..
    rm -rf ultralytics
    git clone https://github.com/ultralytics/ultralytics
    cd ultralytics
    pip install -e .

If these steps don't help, it might be useful to check if there are any known issues with the specific build tools on the NVIDIA Jetson TX2 platform. Let me know how it goes!

@glenn-jocher glenn-jocher added the non-reproducible Bug is not reproducible label May 19, 2024
@Boatsure
Copy link
Author

@glenn-jocher Thanks for your reply!
Upgrading pip and setuptools, cleaning the pip cache and Re-cloning the repository don't resolve the issue.
Fortunately, manually adding a setup.py file and add the project path to python path of system environment works!
Don't know why, I'll keep looking.
Thank you!

@glenn-jocher
Copy link
Member

@Boatsure hi there! I'm glad to hear that manually adding a setup.py file and updating your system's Python path resolved the issue! 🎉 It sounds like your environment might have specific requirements or configurations that necessitate these steps. If you discover more about why this solution worked, feel free to share your findings. It could be very helpful for others facing similar issues. Thanks for updating us, and happy coding with YOLOv8! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-reproducible Bug is not reproducible
Projects
None yet
Development

No branches or pull requests

2 participants