Python中文
首页
教程
问答
标签
搜索
登录
注册
Google colabaratory本地运行时“导入包错误”
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我按照说明将我的colab笔记本连接到本地运行时。但出于某种原因,当我尝试导入像pandas和numpy这样的python包时,它抛出了一个错误</p> <pre><code> TypeErrorTraceback (most recent call last) /usr/lib/python3.8/codeop.py in __call__(self, source, filename, symbol) 134 135 def __call__(self, source, filename, symbol): --> 136 codeob = compile(source, filename, symbol, self.flags, 1) 137 for feature in _features: 138 if codeob.co_flags & feature.compiler_flag: TypeError: required field "type_ignores" missing from Module </code></pre> <p>帮助解决这个问题! 这是我尝试导入的任何包的情况</p> <p>注意:通过jupyter笔记本托管的本地运行时连接</p> <p>此错误不仅出现在导入时,而且还出现在它下面的所有代码中(可能是因为它下面的代码使用了导入包)</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>删除虚拟环境,然后再次创建虚拟环境解决了此问题。以下方法解决了该问题:</p> <pre><code>pip uninstall notebook pip3 install ignore-installed no-cache-dir upgrade notebook </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何在乒乓球比赛中预测球的轨迹,对于AI球拍预测?
4 回答
如何在乒乓球游戏中阻止球
5 回答
如何在乘法和模中不乘空间?
8 回答
如何在乘法和除以2个不同的数字之间进行交换?
5 回答
如何在也是数据一部分的单个字符上拆分大字符串
8 回答
如何在乾草堆中找到針,有更好的解決方案嗎?
9 回答
如何在事件wxWidgets中传递自定义数据
10 回答
如何在事件中使用lambda i=i?
4 回答
如何在事件中心只接收最近的数据
8 回答
如何在事件发生之前保持云函数运行?
9 回答
如何在事件发生后使页面重定向到同一页面
9 回答
如何在事件回调之间保持python生成器的状态
3 回答
如何在事件处理程序(pythonsocket、sphinx)中保留docstring
8 回答
如何在事件处理程序中更改wxRichTextCtrl的光标位置?
1 回答
如何在事件处理程序中访问外部对象?
6 回答
如何在事件循环中将协程打包为正常函数?
6 回答
如何在事件循环之外运行协同程序?
9 回答
如何在事件循环结束时为并发未来的所有线程调用类方法?
10 回答
如何在事件文件中只保留一份摘要?
3 回答
如何在事件模板中添加事件
5 回答