python - TemporaryDirectory() throws an attribute error when program runs
问题描述
I am attempting to create a temporary directory using with tempfile.TemporaryDirectory() as directory:
I have imported tempfile
When I run the program I get the error:
Traceback (most recent call last):
File "batch.py", line 79, in <module>
with tempfile.TemporaryDirectory() as directory:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
I am running python 3.8
The program will run successfully if run with the debugger but when I run it without the debugger I get this error.
解决方案
推荐阅读
- c# - 二分搜索二维数组
- c# - 枚举变量列表
- scala - 我将如何合并这两个数据帧以在 Spark Scala 中生成第三个数据帧?
- ios - Swift:Firebase 查询永远不会调用
- windows - LsaLookupAuthenticationPackage 返回 0xc00000fe
- postgresql - 使用 ts_vectors 和 ST_Distance 搜索结果
- laravel - SQLSTATE[HY000]:一般错误:1366 错误的字符串值:'\x8C5\xB7\x9D\x11\xFD...' 用于 laravel voyager 坐标输入
- python - 等待 Scapy 回调函数
- r - R biomaRt 包:获取链接数据库中的所有值
- android - Fragment中BottomNavigation和Scrollview的问题