Windows下Anaconda环境Python3.6.3安装TensorFlow报错"No module named tensorflow"求助
Hey there! Let's clear this up first: TensorFlow does support Python 3.6.3—specifically, TensorFlow 1.x releases (like the stable 1.15.x series) and early TensorFlow 2.x versions (up to 2.3.x) are fully compatible with this Python version. The "No module named tensorflow" error you're seeing is almost certainly tied to environment configuration missteps, not version incompatibility.
Here are the most common fixes to get this working:
Make sure you're activating the correct Anaconda environment first
It's easy to forget this step! Before installing or running TensorFlow, always activate your dedicated environment with:conda activate your_environment_nameIf you skip this, you'll be operating in the base environment (where you didn't install TensorFlow), hence the missing module error.
Double-check your installation command
Stick to a version of TensorFlow confirmed to work with Python 3.6.3:- For TensorFlow 1.x (great for legacy projects):
pip install tensorflow==1.15.5 - For TensorFlow 2.x (the latest compatible release):
pip install tensorflow==2.3.4
Avoid mixing
conda installandpip installfor TensorFlow—pick one package manager to prevent dependency conflicts.- For TensorFlow 1.x (great for legacy projects):
Verify your environment's Python version
When creating your Anaconda environment, explicitly specify Python 3.6.3 to ensure no auto-upgrades happen:conda create -n your_environment_name python=3.6.3You can confirm the version post-creation by running:
python --versioninside the activated environment.
Test the installation directly
After installing, stay in the activated environment, launch Python withpython, then run:import tensorflow as tf print(tf.__version__)If this runs without errors, you're good to go!
内容的提问来源于stack exchange,提问作者Reza

