Anaconda 中解决ipython和conda Python版本不匹配的问题

运行TensorFlow、torch等出现报错如下:

This version of python seems to be incorrectly compiled
(internal generated filenames are not absolute).

The debugger may still function, but it will work slower and may miss breakpoints.
Related bug: http://bugs.python.org/issue1666807

之前没有意识到python 3.11环境需要单独安装ipython;我以为它是 anaconda 的默认部分。这是出错时的对应情况

 解决办法:激活TensorFlow后,在TensorFlow下安装ipython: 即 conda install ipython

 安装完成后再看一下对应情况:

 可以看到,ipython由之前的8.12.0变成了8.15.0

此时,再运行之前的代码,就不会报错了。

 

posted @ 2023-09-12 10:21  夕月一弯  阅读(1377)  评论(0编辑  收藏  举报