aiofiles icon indicating copy to clipboard operation
aiofiles copied to clipboard

OS module import fails

Open Wh1teStr1pe opened this issue 3 years ago • 9 comments

image

Cannot import correctly anything from os.path module and cannot use its functions like path.exists()

Wh1teStr1pe avatar Feb 12 '22 13:02 Wh1teStr1pe

Ah, you're saying from aiofiles.os.path import exists doesn't work?

Tinche avatar Feb 13 '22 19:02 Tinche

@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

Wh1teStr1pe avatar Feb 14 '22 07:02 Wh1teStr1pe

I had the same issue today. Installing types-aiofiles wouldn't help me though. Python 3.10.1

realsuayip avatar Feb 18 '22 19:02 realsuayip

Same thing. Seeing this in mypy: error: Module has no attribute "os" [attr-defined]

cpvandehey avatar Apr 10 '23 23:04 cpvandehey

you need to import aiofiles.os I had to look into the sources to deduce it...

ehn-pkalinowski avatar May 16 '23 01:05 ehn-pkalinowski

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.

xhy2008 avatar Jan 22 '24 23:01 xhy2008