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

ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found #11417

Closed
2 tasks done
LiuQiTangli opened this issue Apr 23, 2023 · 11 comments
Closed
2 tasks done
Labels
bug Something isn't working Stale

Comments

@LiuQiTangli
Copy link

LiuQiTangli commented Apr 23, 2023

Search before asking

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

YOLOv5 Component

Detection

Bug

Using the pycharm tool, it works fine.
I tried to execute the detection video from the command line, but it didn't work and reported an error:

(climb) wj@work:~/Project/yolov5-master$ python detect.py --weights yolov5n.pt --source ~/Data/others/cunBA.mp4
Traceback (most recent call last):
File "detect.py", line 45, in
from models.common import DetectMultiBackend
File "/home/wj/Project/yolov5-master/models/common.py", line 28, in
from utils.dataloaders import exif_transpose, letterbox
File "/home/wj/Project/yolov5-master/utils/dataloaders.py", line 31, in
from utils.augmentations import (Albumentations, augment_hsv, classify_albumentations, classify_transforms, copy_paste,
File "/home/wj/Project/yolov5-master/utils/augmentations.py", line 15, in
from utils.general import LOGGER, check_version, colorstr, resample_segments, segment2box, xywhn2xyxy
File "/home/wj/Project/yolov5-master/utils/general.py", line 41, in
from utils.metrics import box_iou, fitness
File "/home/wj/Project/yolov5-master/utils/metrics.py", line 10, in
import matplotlib.pyplot as plt
File "/home/wj/anaconda3/envs/climb/lib/python3.8/site-packages/matplotlib/init.py", line 131, in
from . import _api, _version, cbook, _docstring, rcsetup
File "/home/wj/anaconda3/envs/climb/lib/python3.8/site-packages/matplotlib/rcsetup.py", line 27, in
from matplotlib.colors import Colormap, is_color_like
File "/home/wj/anaconda3/envs/climb/lib/python3.8/site-packages/matplotlib/colors.py", line 56, in
from matplotlib import _api, _cm, cbook, scale
File "/home/wj/anaconda3/envs/climb/lib/python3.8/site-packages/matplotlib/scale.py", line 22, in
from matplotlib.ticker import (
File "/home/wj/anaconda3/envs/climb/lib/python3.8/site-packages/matplotlib/ticker.py", line 138, in
from matplotlib import transforms as mtransforms
File "/home/wj/anaconda3/envs/climb/lib/python3.8/site-packages/matplotlib/transforms.py", line 49, in
from matplotlib._path import (
ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/wj/anaconda3/envs/climb/lib/python3.8/site-packages/matplotlib/_path.cpython-38-x86_64-linux-gnu.so)

why?

Environment

  • YOLOv5 🚀 2023-4-10 Python-3.8.16 torch-1.10.1+cu113 CUDA:0 (NVIDIA GeForce RTX 3060, 12044MiB)
  • OS: ubuntu 20.04
  • python 3.8.16

Minimal Reproducible Example

Based on the source code, only yolov5n.pt was added, everything else was left unchanged.

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@LiuQiTangli LiuQiTangli added the bug Something isn't working label Apr 23, 2023
@github-actions
Copy link
Contributor

👋 Hello @LiuQiTangli, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like 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 provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. 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.

Introducing YOLOv8 🚀

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics

@glenn-jocher
Copy link
Member

@LiuQiTangli, the error message indicates that your matplotlib installation is incompatible with the system's libstdc++. The easiest way to solve this is to reinstall matplotlib via pip which should use the compatible dependencies. Please try running pip install matplotlib --no-cache-dir --force-reinstall to reinstall matplotlib and see if this solves the issue.

If the issue persists or you have other questions, please let us know.

@ShAmoNiA
Copy link
Contributor

ShAmoNiA commented Apr 23, 2023

Hi @LiuQiTangli,
I had this issue too.
It looks like there's an issue with the version of the C++ standard library that Matplotlib is trying to use. Basically, it needs a newer version than what's currently installed on your system.

To fix this, you can try updating your system's packages by running sudo apt-get update and sudo apt-get upgrade. Then, install the latest version of the C++ standard library by running sudo apt-get install libstdc++6.

If that doesn't work, you can try uninstalling and then reinstalling Matplotlib by running pip uninstall matplotlib and then pip install matplotlib.

At the end, all of above solutions didn't fix my problem; I changed my environment from Conda to Python's virtual environment and everything worked perfectly for me. Perhaps Conda was causing some difficulties with this issue.

@glenn-jocher
Copy link
Member

Thank you for sharing your experience dealing with this issue @ShAmoNiA! Updating your system's packages and installing the latest C++ standard library can indeed help address compatibility issues with Matplotlib. And as you've mentioned, switching from Conda to a Python virtual environment or environment manager is worth considering if the issue persists. Sometimes, environment managers like Conda can interfere with path dependencies and cause issues like this.

@github-actions
Copy link
Contributor

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale label May 24, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2023
@aylive
Copy link

aylive commented Aug 7, 2023

I met the same problem under py3.10 + torch2.0, and here's the process I solve it,

  1. The c++ package is required by an old matplotlib package, so first pip install -U matplotlib
  2. Still doesn't work beacause a dependency package of matplotlib, kiwisolver is not automatically updated to the newest, so
    (1) uninstall the package, pip uninstall kiwisolver
    (2) reinstall it, pip install -U kiwisolver
    That get solved. Hope this can be helpful.

@glenn-jocher
Copy link
Member

Thank you for sharing your solution @aylive! We appreciate your contribution to resolving this issue. By upgrading matplotlib and ensuring kiwisolver is up-to-date, you were able to successfully address the problem. We will keep this solution in mind for future reference. If you have any further questions or encounter any other issues, please don't hesitate to let us know.

@emmanuelmoupojou2
Copy link

@LiuQiTangli, the error message indicates that your matplotlib installation is incompatible with the system's libstdc++. The easiest way to solve this is to reinstall matplotlib via pip which should use the compatible dependencies. Please try running pip install matplotlib --no-cache-dir --force-reinstall to reinstall matplotlib and see if this solves the issue.

If the issue persists or you have other questions, please let us know.

This solved the issue for me. Thanks!

@glenn-jocher
Copy link
Member

@emmanuelmoupojou2 great to hear that the suggested solution worked for you! We're glad that reinstalling Matplotlib using pip install matplotlib --no-cache-dir --force-reinstall resolved the compatibility issue with the system's libstdc++. If you have any further questions or encounter any other issues, please feel free to ask.

@KaimingZhu
Copy link

I met the same problem under py3.10 + torch2.0, and here's the process I solve it,

  1. The c++ package is required by an old matplotlib package, so first pip install -U matplotlib
  2. Still doesn't work beacause a dependency package of matplotlib, kiwisolver is not automatically updated to the newest, so
    (1) uninstall the package, pip uninstall kiwisolver
    (2) reinstall it, pip install -U kiwisolver
    That get solved. Hope this can be helpful.

Thanks a lot, you save my day :)

@glenn-jocher
Copy link
Member

@KaimingZhu i'm thrilled to hear that the solution worked for you! 😊 Big thanks for sharing your experience; it's greatly appreciated and could certainly help others in the community facing similar issues. Remember, we're here to help, so don't hesitate to reach out with more questions or insights. Happy coding!

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

No branches or pull requests

6 participants