I've been working on learning artificial intelligence and how to code with Python.I was working on a project and I decided to update some packages of Python which were not new to work on then something happened and I can't compile my codes.I deleted Anaconda3 and set it up again but not worked. I've been seeing this problem which I wrote as a topic.If someone helps me,I would be appriciated to get some help.
>>> import tensorflow as tf
File "C:\Users\AliGalip\Anaconda3Yeni\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\AliGalip\Anaconda3Yeni\lib\site-packages\tensorflow\python\__init__.py", line 63, in <module>
from tensorflow.python.framework.framework_lib import * # pylint: disable=redefined-builtin
File "C:\Users\AliGalip\Anaconda3Yeni\lib\site-packages\tensorflow\python\framework\framework_lib.py", line 104, in <module>
from tensorflow.python.framework.importer import import_graph_def
File "C:\Users\AliGalip\Anaconda3Yeni\lib\site-packages\tensorflow\python\framework\importer.py", line 32, in <module>
from tensorflow.python.framework import function
File "C:\Users\AliGalip\Anaconda3Yeni\lib\site-packages\tensorflow\python\framework\function.py", line 36, in <module>
from tensorflow.python.ops import resource_variable_ops
File "C:\Users\AliGalip\Anaconda3Yeni\lib\site-packages\tensorflow\python\ops\resource_variable_ops.py", line 35, in <module>
from tensorflow.python.ops import variables
File "C:\Users\AliGalip\Anaconda3Yeni\lib\site-packages\tensorflow\python\ops\variables.py", line 40, in <module>
class Variable(checkpointable.CheckpointableBase):
AttributeError: module 'tensorflow.python.training.checkpointable' has no attribute 'CheckpointableBase'
The same question has been posted as a GitHub issue. In particular, the solution suggested by @allanlavoie is likely relevant here as well:
Since it is apparent from your question that you're using Anaconda to manage your Python environments, if the above fails to solve your problem, you can try to install TensorFlow in a clean conda environment as follows:
conda create --name tftest
. (You can replacetftest
with e.g. the name of your current project.)activate tftest
(orsource activate tftest
if you happen to be using MSYS2's bash, or something similar to that).conda install tensorflow
.where python
(which should produce a path containing "tftest").python
.import tensorflow as tf
in a shell in that environment.Since you are using PyCharm (cf. the comments for this answer), you will then want to set up PyCharm for using this new environment instead. Indeed, using a new environment for every project, while disk space-intensive, is a good way of avoiding dependency issues for these rather dependency-heavy numerical packages.