-
Notifications
You must be signed in to change notification settings - Fork 491
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
Environment setup instructions #573
Comments
When running “pip install -e .”, I encountered an error message stating: "Defaulting to user installation because normal site-packages is not writeable. ERROR: File 'setup.py' not found. Directory cannot be installed in editable mode: /media/data/code_others/YOLO-World. (A 'pyproject.toml' file was found, but editable mode currently requires a setup.py based build.)" Could you provide any advice on how to resolve this issue? |
Maybe you should check the folder permission or update pip. By the way, you can get the solution easily by google (I already done). |
Thank you for this instructions! It is really helpful. Good Luck to you. |
here's my Dockerfile and pyproject and hope someone will find it useful :) https://github.com/ZreXoc/YOLO-World/blob/master/Dockerfile |
Motivation
Hi all, due to the unclear environment setup and the many questions in the issue, it took me two days to finally set it up successfully. I’d like to summarize my experience here to help more people.
Equipment
GTX 4090
Installation
1. Install torch
In my case, I install torch=2.0.0 with cuda 11.8 (according to nvcc -V result)
2. Install mmcv
Here is a mmcv official link: https://mmcv.readthedocs.io/en/latest/get_started/installation.html.
And choose a proper version to device.(Fit above setting torch=2.0.0, cuda=11.8)
IMPORTANT: When choosing mmcv version, do NOT choose >= 2.1.0.. Because Yolo world leverage mmyolo which version is 0.6.0. And the version shoud match mmcv>=2.0.0rc4, <2.1.0.(https://mmyolo.readthedocs.io/zh-cn/latest/get_started/dependencies.html)
3. Install requirement.txt
Download this repo by
And cd to ./requirements, install reuirement package by your case. For my case, I just want to inference so far, so I install demo_requirements.txt.
4. Install yolo-world
This step is the most frustrating of all. When running pip install -e ., the system follows pyproject.toml to install packages. However, the package versions specified in pyproject.toml are incorrect. As a result, executing this command will cause pip to uninstall the existing packages (such as Torch, MMCV, etc.) and install the latest versions, which can mess up the proper package versions for your device.
So before running pip install -e ., we must install the proper package version manually.
And then, edit dependencies in pyproject.toml in my case
Assign the packege version which installed to avoid pip re-install latest package.
After saving pyproject.toml we can run install script now.
5. Download weight and execute demo cammend
Trouble shooting
Problem 1
This means pip install -e . fail. The reason is the version of transformers is too old. Please reinstall a new one and re-install pip install -e .
Solution issue: #267
Relative issues: #218 #403
Problem 2
When you install mmcv by pip, some people will see this error. Because some module of mmcv are not installed.
Solution: Before execute pip to install mmcv, please export this two variables
then install mmcv
After install mmcv, we can check if ._ext module is installed successfully
There are no error message, you install successfully.
Relative issues: #353 #231 #125 #198
Problem 3
The error just like mmyolo message, according to https://mmyolo.readthedocs.io/zh-cn/latest/get_started/dependencies.html.
The latest mmyolo=0.6.0 just support <mmcv2.1.0, so the highest mmcv version only 2.0.1 can be used. You should check your mmcv version by following, the output should under 2.1.0:
https://mmyolo.readthedocs.io/zh-cn/latest/get_started/installation.html

Relative issues: #364 #279 #231
Problem 4
Some problem when installing transformers. I found that when python=3.10, the above error message will show. Then I change python to 3.8, install transformers will be success.
Problem 5
The error message refer to Cargo or Rust, but the real problem is about transformers. You should install transformers before pip install -e . , I trend not to rely on the cammend but manually install the transformers package. pip install transformers==4.33.0 in my case.
Thanks to the contributors for making YOLO-World an open-source repository. Also, thank you for reading this instruction — I hope it truly helps you!
The text was updated successfully, but these errors were encountered: