在Python环境安装TensorFlow遇pip命令未识别问题求助
Hey there, let's get this sorted out! The error you're seeing happens because the pip command isn't properly available in your activated tensorflow conda environment—this usually occurs when pip didn't install correctly during the initial environment setup. Here's how to fix it step by step:
Step 1: Re-verify your environment activation
First, let's make sure you're in the right environment. Sometimes activation can be finicky, so let's reset it:
conda deactivate conda activate tensorflow
You should see (tensorflow) at the start of your command line prompt once the environment is activated properly.
Step 2: Install pip via Conda in your environment
Since pip isn't being recognized, let's explicitly install it using Conda (this guarantees it's tied directly to your tensorflow environment):
conda install pip
Wait for this to complete—Conda will handle installing pip and any required dependencies automatically.
Step 3: Install TensorFlow GPU
Now that pip is properly set up in your environment, run your original install command again:
pip install --ignore-installed --upgrade tensorflow-gpu
Why this works
When you ran conda create -n tensorflow pip python=3.5, Conda is supposed to auto-install pip alongside Python 3.5. But network glitches or cached data can sometimes cause this step to fail. By installing pip directly via Conda, we ensure it's placed in the correct environment's Scripts directory, which gets added to your system PATH when the environment is activated.
内容的提问来源于stack exchange,提问作者user8787011

