ultralytics icon indicating copy to clipboard operation
ultralytics copied to clipboard

Unable to install editable

Open Dentikka opened this issue 1 month ago โ€ข 2 comments

Search before asking

  • [x] I have searched the Ultralytics YOLO issues and found no similar bug report.

Ultralytics YOLO Component

Install

Bug

I try to install Ultralytics in my python environment in the editable mode. But i get the following error in model import:

python -c "from ultralytics import YOLO"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'YOLO' from 'ultralytics' (unknown location)

When I run the same command with non-editable installation, everything works just fine

Environment

The problem persists with newer and older versions: ultralytics==8.3.228 and ultralytics==8.2.40

I install the package from source:

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

This produces the newest version 8.3.228 for me.

And for the the older version I also install from source using different tag:

git checkout v8.2.40

Minimal Reproducible Example

git clone https://github.com/ultralytics/ultralytics.git
pip install -e ultralytics/
python -c "from ultralytics import YOLO"

Additional

No response

Are you willing to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

Dentikka avatar Nov 14 '25 11:11 Dentikka

๐Ÿ‘‹ Hello @Dentikka, thank you for your detailed report and for using Ultralytics ๐Ÿš€! This is an automated response to help gather initial details; an Ultralytics engineer will review your issue and assist you further soon.

Youโ€™ve already shared a helpful Minimal Reproducible Example (MRE) ๐Ÿ™Œ. For ๐Ÿ› installation/import bugs like this, itโ€™s especially useful to also include, if possible:

  • Your OS and version (e.g., Ubuntu, Windows, macOS)
  • Your Python version
  • Your pip version and how you create/manage your environment (venv, conda, etc.)
  • The exact command you use to activate the environment before running python -c "from ultralytics import YOLO"

If this is a ๐Ÿ› Bug Report and you refine your minimum reproducible example further (for example by including full console logs from pip install -e ultralytics/ and the import error), that will help us debug it even faster.

If this is a custom training โ“ Question related to using editable installs for development, please provide as much information as possible, including what workflows you are trying to enable with pip install -e, and verify you are following our Tips for Best Training Results.

You can also connect with the community for more real-time or in-depth help:

  • For real-time chat, join our Discord ๐ŸŽง
  • For longer-form technical discussions, visit Discourse
  • To share knowledge and see how others work with YOLO, check out our Subreddit

Upgrade

Before we dig in, please make sure youโ€™ve tested with the latest ultralytics package and all requirements in a Python>=3.8 environment with PyTorch>=1.8. This helps confirm the issue is not already resolved in the latest release:

pip install -U ultralytics

Environments

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

These can be useful to compare behavior between your local editable install and a known-good reference environment.

Status

Ultralytics CI

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

UltralyticsAssistant avatar Nov 14 '25 11:11 UltralyticsAssistant

You need to cd into the ultralytics folder.

Y-T-G avatar Nov 14 '25 11:11 Y-T-G

Thanks! But what if I need to run some pipeline using Ultralytics in another working directory?

Dentikka avatar Nov 15 '25 15:11 Dentikka

It would work. The original error is caused because you're importing the ultralytics repo directory instead of the package, because the ultralytics in your working directory is the cloned repo, not the package. When you cd into it or move to any other folder that doesn't contain ultralytics folder, Python will correctly import the package.

Y-T-G avatar Nov 15 '25 15:11 Y-T-G

Okay, thanks! Now I understand how it works! Sorry for the disturbance

Dentikka avatar Nov 16 '25 13:11 Dentikka

No worries at all, glad itโ€™s clear nowโ€”if you ever need a reference for install/editable setups, the steps in the Install Ultralytics guide stay up to date and are safe to follow.

glenn-jocher avatar Nov 17 '25 07:11 glenn-jocher