Skip to content

"What libraries should I install to use PyTorch and YOLOv5? I am using PyCharm and Visual Studio." #13579

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

Open
1 task done
joseant7231 opened this issue Apr 27, 2025 · 2 comments
Labels
dependencies Dependencies and packages question Further information is requested

Comments

@joseant7231
Copy link

Search before asking

Question

Good morning, good afternoon, or good evening. I am using Visual Studio Code and also PyCharm with the Python language. I would like to perform image recognition on a video, but I am encountering errors with Torch and YOLOv5. Could you please help me by telling me which libraries I should install first? Thank you very much for your possible response.

Additional

Image

@joseant7231 joseant7231 added the question Further information is requested label Apr 27, 2025
@UltralyticsAssistant UltralyticsAssistant added the dependencies Dependencies and packages label Apr 27, 2025
@UltralyticsAssistant
Copy link
Member

👋 Hello @joseant7231, thank you for your interest in YOLOv5 🚀! This is an automated response to help you get started quickly—an Ultralytics engineer will also assist you soon.

Please visit our ⭐️ Tutorials for detailed guides—including Custom Data Training and Hyperparameter Evolution.

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 include as much information as possible, such as dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

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

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

😊 If you encounter further issues, please provide additional details or screenshots to help us assist you!

@pderrenger
Copy link
Member

Hi @joseant7231,

To use YOLOv5 for video recognition, install the required dependencies with:

pip install -r https://raw.githubusercontent.com/ultralytics/yolov5/master/requirements.txt

This installs PyTorch and all necessary libraries. For video processing specifically, ensure OpenCV is properly installed:

pip install opencv-python-headless

You can also clone the repository and install everything at once:

git clone https://github.com/ultralytics/yolov5
cd yolov5
pip install -r requirements.txt

For detailed setup instructions, check our Quickstart guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Dependencies and packages question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants