无法导入没有弹出错误的tensorflow

2024-06-17 13:24:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用带有Centos系统的服务器

最初,我使用的是tensorflow-gpu=1.14。 我必须把它更新到一个新版本

因此,我用python=3.7创建了一个新的conda环境

我试图pip install tensorflow但是ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. 显示出来了

所以我找到了一个解决方案来解决这个问题


在那之后,我试图在jupyter实验室导入tensorflow。但是该单元永远运行,一些信息显示在cmd窗口中

[I 10:52:26.791 LabApp] Starting buffering for 93fcfc5c-c6f5-43b4-9756-38fdffb4e158:27aece01-3fde-4ef2-9118-1bd56b480fef
[I 10:52:34.407 LabApp] 302 GET / (192.168.1.143) 1.07ms
[I 10:52:36.157 LabApp] Adapting to protocol v5.1 for kernel 93fcfc5c-c6f5-43b4-9756-38fdffb4e158
[I 10:52:36.227 LabApp] Build is up to date
[I 10:52:42.123 LabApp] KernelRestarter: restarting kernel (1/5), keep random ports
kernel 93fcfc5c-c6f5-43b4-9756-38fdffb4e158 restarted
[I 10:52:44.805 LabApp] Adapting to protocol v5.1 for kernel 93fcfc5c-c6f5-43b4-9756-38fdffb4e158
[I 10:54:36.629 LabApp] Saving file at /Speech/Feature_engineering/PCA.ipynb


如果我在cmd中运行import tensorflow

(tf24) [test@DL-200 ~]$ python
Python 3.7.0 (default, Jun 28 2018, 13:15:42) 
[GCC 7.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Illegal instruction

更新

我已经卸载了wrapt并重新安装了tensorflow,但问题没有得到解决

基本上,我已经删除了环境并重新启动了所有内容,但它不起作用


Tags: toimportcmdwhichfor环境istensorflow