4

When I tried to run the YOLOv5 train.py, I don't know what was wrong with it. pandas is installed.

Traceback (most recent call last):
  File "/home/jasmine/Desktop/fyp/yolov5/yolov5/utils/general.py", line 26, in <module>
    import pandas as pd
  File "/home/jasmine/anaconda3/lib/python3.8/site-packages/pandas/__init__.py", line 52, in <module>
    from pandas.core.api import (
  File "/home/jasmine/anaconda3/lib/python3.8/site-packages/pandas/core/api.py", line 14, in <module>
    from pandas.core.algorithms import factorize, unique, value_counts
  File "/home/jasmine/anaconda3/lib/python3.8/site-packages/pandas/core/algorithms.py", line 58, in <module>
    from pandas.core.indexers import validate_indices
  File "/home/jasmine/anaconda3/lib/python3.8/site-packages/pandas/core/indexers/__init__.py", line 1, in <module>
    from pandas.core.indexers.utils import (
  File "/home/jasmine/anaconda3/lib/python3.8/site-packages/pandas/core/indexers/utils.py", line 18, in <module>
    from pandas.util._exceptions import find_stack_level
ImportError: cannot import name 'find_stack_level' from 'pandas.util._exceptions' (/home/jasmine/anaconda3/lib/python3.8/site-packages/pandas/util/_exceptions.py)
Julia Meshcheryakova
  • 3,162
  • 3
  • 22
  • 42
jasssss
  • 41
  • 1
  • 1
  • 2

4 Answers4

1

I was facing a similar problem with pandas version 1.4.2. Try using a different pandas version. version 1.3 worked for me.

Julia Meshcheryakova
  • 3,162
  • 3
  • 22
  • 42
Nithin
  • 11
  • 1
1

I had this when upgrading from pandas 1.3.x to 1.4.2. In my case deleting my conda env and recreating fixed it.

Julia Meshcheryakova
  • 3,162
  • 3
  • 22
  • 42
owennewo
  • 301
  • 2
  • 3
0

I had the same problem with pandas version 1.2.4. I found out that my pip version was an older one. So, I upgraded pip using

C:\Anaconda\python.exe -m pip install --upgrade pip

which installed pandas version 1.3.2 and solved the issue.

Julia Meshcheryakova
  • 3,162
  • 3
  • 22
  • 42
0

I had the same problem too. I had pandas-1.5.2 on my production server. Simply ran pip3 install pandas==1.3.2 and it solved my issue.

Julia Meshcheryakova
  • 3,162
  • 3
  • 22
  • 42
Mutombo
  • 1
  • 1