Hello I am trying to split a path into directory and filename, on Windows. I am using the os.path.basepath API to accomplish that on Windows, but I am getting this error.
I tried upgrading pip3 followed by os_sys module, but still getting this error. Anyone can help me understand what is going on with os.path.basepath on Windows 11?
I have exhausted google search and reading blogs over this, but nothing is working at this point.
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.basepath("c:\node\text.txt")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'ntpath' has no attribute 'basepath'
>>>