Tinche / aiofiles

File support for asyncio
Apache License 2.0
2.88k stars 153 forks source link

AttributeError("module 'aiofiles' has no attribute 'tempfile'") #186

Closed RomanPerekhrest closed 4 months ago

RomanPerekhrest commented 5 months ago

Got AttributeError("module 'aiofiles' has no attribute 'tempfile'") on line: async with aiofiles.tempfile.TemporaryFile('w') as f:.

Python version: 3.10.12 OS: Ubuntu 22

Tinche commented 5 months ago

Which version of aiofiles are you using? You can check with pip list.

RomanPerekhrest commented 4 months ago

Which version of aiofiles are you using?

it's '0.3.2'.

Tinche commented 4 months ago

Oh that's pretty ancient. The tempfile thing was added in 0.7. You'll need to upgrade.

lmaddox commented 3 months ago

thank you. pip install -U aiofiles fixed it for me.