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

AttributeError: 'Path' object has no attribute 'namebase' #4

Open
Tom-P7 opened this issue Apr 14, 2021 · 1 comment
Open

AttributeError: 'Path' object has no attribute 'namebase' #4

Tom-P7 opened this issue Apr 14, 2021 · 1 comment

Comments

@Tom-P7
Copy link

Tom-P7 commented Apr 14, 2021

module_name = f.namebase

The correct attribute should be 'basename'.

@gantonayde
Copy link

The f object has two properties with the word name in it. These are basename and name. In my case, basename returns a method and the import fails with:

TypeError: join() argument must be str, bytes, or os.PathLike object, not 'method'

Changing the line in:

module_name = f.namebase

to module_name = f.name solved the problem as f.name returns the name of the file.

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

No branches or pull requests

2 participants