Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

TypeError: expected str, bytes or os.PathLike object, not NoneType Aborted (core dumped) #917

Open
knotgrass opened this issue Jul 18, 2022 · 17 comments

Comments

@knotgrass
Copy link

  • OS: ubuntu 20.04
  • PyQt version: pyqt5==5.14.1 ; PyQt5-sip==12.11.0

I build labelImg from source in July18 - 2022
and i have a problem when i open folder contain xml annotation
But i install using pip , every seem OK
If you want more infomation, please let me know. Thank you
Here is console log.

(base) user@PCname:~/snap/labelImg$ python labelImg.py 
/home/agent/snap/labelImg/labelImg.py:213: DeprecationWarning: an integer is required (got type DockWidgetFeatures).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  self.dock.setFeatures(self.dock.features() ^ self.dock_features)
Traceback (most recent call last):
  File "/home/agent/snap/labelImg/labelImg.py", line 1309, in change_save_dir_dialog
    self.show_bounding_box_from_annotation_file(self.file_path)
  File "/home/agent/snap/labelImg/labelImg.py", line 1182, in show_bounding_box_from_annotation_file
    basename = os.path.basename(os.path.splitext(file_path)[0])
  File "/home/agent/anaconda3/lib/python3.9/posixpath.py", line 118, in splitext
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Aborted (core dumped)
@Evelyn0402
Copy link

Hello,

Have you sovled this problem? I had the same one as you

@knotgrass
Copy link
Author

Hello,

Have you sovled this problem? I had the same one as you

i using pip to install, and i can using labelImg

@Evelyn0402
Copy link

pip install also works for me, thanks!

@Overlrd
Copy link

Overlrd commented Aug 10, 2022

pip install works
thanks

@xavier-dc
Copy link

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

@AaronG18
Copy link

AaronG18 commented Sep 1, 2022

this works, thanks

@AaronG18
Copy link

AaronG18 commented Sep 1, 2022

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

thanks a lot

@haltersweb
Copy link

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

Thanks, this works!!

@WangYutongNEU
Copy link

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

Thanks, it works!!!

@Haastrup88
Copy link

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.
thank you

@KAkikakuFukuhara
Copy link

KAkikakuFukuhara commented Jan 6, 2023

The problem seems to occur after the application starts, hits the "open_dir" button to determine the image directory, and determines the save directory.

This issue was added in commit 5bc7fb9 .

As a countermeasure other than editing the code, it seems that the problem can be avoided by unchecking the "auto_save" checkbox.

@Shrutikute09
Copy link

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.
thank you

where does one have to change this line.... in which file?
......facinf the same error on my Mac while using labelImg

@KAkikakuFukuhara
Copy link

@VikashPR
Copy link

VikashPR commented Mar 5, 2023

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

Thank you, It works 👍🏽

@semanurbilada
Copy link

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

This really works!
Even though I tried git pull from the repository it says: Already up to date!
Since labelImg changed a while ago, this was one of the most efficient solutions, thxx.

@NodirByte
Copy link

what after pip install ...?

tecount-fr added a commit to Tecount/labelImg that referenced this issue Jun 16, 2023
@bhavit89
Copy link

bhavit89 commented Aug 4, 2023

expected str, bytes or os.PathLike object, not NoneType
how to resolve this i tried reinstalling it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

15 participants