'ImportError: the 'trace' from 'tensorflow.python.profiler'

I were using environments for months and they were working perfectly.. suddenly i can not execute any code in pycharm under any virtual environment and i get this error massage:

from tensorflow.python.profiler import trace ImportError: cannot import name 'trace' from 'tensorflow.python.profiler' (C:\Users\Nuha\anaconda3\envs\tf_1.15\lib\site-packages\tensorflow_core\python\profiler_init_.py)

Any help please!! It seams that it happens because i install more packages and maybe conflict occurs



Solution 1:[1]

it was because environment conflict so i rebuild new environment and it works perfectly

Solution 2:[2]

Try to install trace

pip3 install trace

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nuha
Solution 2