简体   繁体   中英

Tensorflow import issues on the anaconda virtual environment

I'm using OS X now and got a problem with importing tensorflow. I'm using anaconda and made a new virtual environment with python 3.7 and tensor flow 1.15.0. I've no problem so far but from yesterday I got error massages like below

import tensorflow as tf

Traceback (most recent call last): File "", line 1, in File "/usr/local/anaconda3/envs/python3.7_tf1/lib/python3.7/site-packages/tensorflow/ init .py", line 99, in from tensorflow_core import * File "/usr/local/anaconda3/envs/python3.7_tf1/lib/python3.7/site-packages/tensorflow_core/ init .py", line 28, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import ImportError: cannot import name 'pywrap_tensorflow' from 'tensorflow_core.python' (unknown location)

I tried to make a new virtual environment and set the same setting but it didn't work neither. what should I do?

Problem solved. The main issue was a directory of python file that I tried to run by using conda. I moved that file out of problematic folder and it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM