I will simply leave this here because none of the other approaches worked for me. Also, I can look it up myself when I need it for new devices.
THIS IS THE WAY IT WORKS:
- Install Anaconda
- Open Anaconda Prompt
conda create --name tensorflow
conda activate tensorflow
- Search with
conda search tensorflow for all available TensorFlow versions
- Choose the one you need (usually the newest one)
- Explicitly name the version now (otherwise it happened to me that version
1.14 was installed): conda install -c conda-forge tensorflow=YOUR_VERSION
- Open Anaconda, choose the new environment and install Spyder
- Install Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019
- Download msvcp140.dll and add the
.dll-File to the Windows\System32 folder
Now it should work like a charm!
TROUBLESHOOTING:
If it still doesn't work, try this, it worked for me:
Open Anaconda-Prompt:
- Create an environment with
Python 3.6 like this: conda create --name tensorflow_env python=3.6
conda activate tensorflow
- Steps 6. and 6. from the list above
conda install tensorflow=YOUR_VERSION(not forge, just like this!)
- Now do steps 8, 9, 10 from above
TENSORFLOW GPU:
If you want to use your GPU, do it the same way as described above, with the only difference to install tensorflow-gpu instead if tensorflow.
And, you must install the newest NVIDIA driver for your GPU, you can find and choose the right one here.
(Yes, in TF 2 there's both, a CPU and GPU support, in the "normal" library. However, if you install tensorflow-gpu via conda, it installs the CUDA and cudNN etc. you need automatically for you - also the right versions. This way easier and faster.)
cp35indicates that your wheel is forCPython3.5-- The different version might be biting you and google may not have released a wheel for 3.6 yet. It's possible that to get it working you'll need to build the whole thing yourself ...conda install -c conda-forge tensorflow?