python - AttributeError:module 'imp' has no attribute 'find_module'
问题描述
I used this code to import in VSCODE editor.
Getting error as below.
Already installed tensorflow by pip install tensorflow
in command line.
Any help please?
import tensorflow
File "C:\Users\david\python3_6\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
AttributeError: module 'imp' has no attribute 'find_module'
解决方案
当我的工作目录包含同名的自定义文件(“imp.py”)时,我遇到了这样的问题。也许,您的项目也包含这样的文件 :) 只需找到并打开引发错误的文件,然后 Ctrl+单击“imp”模块以在单独的选项卡中打开它,看看有什么问题。
推荐阅读
- python - HTTP 错误 404:未找到 urllib.request.urlretrieve
- java - 如何将gradle与maven合并
- tensorflow - 用于RNN的tensorflow tf.keras.layers.Attention
- javascript - 在 Tensorflow.js 中输出大张量的所有值
- discord - 如何显示在 discord.py 上使用命令所需的权限?
- php - 如何在 PDO MySQL 中同时插入两个不同的数组?
- reactjs - 使用 where 的 Firestore 查询条件
- sql - 在 PL/SQL 中处理 JSON 数组
- python - pyspark groupBy 并计算所有列
- go - Maxsubsequence - 这个问题的关键见解是什么?