Open Wh1teStr1pe opened 2 years ago
Ah, you're saying from aiofiles.os.path import exists
doesn't work?
@Tinche yes, there was no way to import path
from aiofiles.os
and use its functions. I could fix it only by running pip install types-aiofiles
I had the same issue today. Installing types-aiofiles wouldn't help me though. Python 3.10.1
Same thing. Seeing this in mypy:
error: Module has no attribute "os" [attr-defined]
you need to
import aiofiles.os
I had to look into the sources to deduce it...
import aiofiles.os Traceback (most recent call last): File "
", line 1, in File "/data/data/com.termux/files/home/aiofiles-23.2.1/src/aiofiles/os.py", line 41, in link = wrap(os.link) ^^^^^^^ AttributeError: module 'os' has no attribute 'link'. Did you mean: 'unlink'?
I got this error. I tried to change a version,but it didn't work.
I got this error. I tried to change a version,but it didn't work.
Getting the same error.
@xhy2008 @n-ce
try this
from aiofiles import os as aos
@xhy2008 @n-ce
try this
from aiofiles import os as aos
I tried to remove the link = wrap(os.link)
line from os.py
yesterday and it worked. I also learned that this is a fixed issue but not released yet.
Cannot import correctly anything from
os.path
module and cannot use its functions likepath.exists()