Ubuntu 16.04环境下TensorFlow GPU版本安装失败求助
Hey there, I’ve run into this exact dependency mismatch before—let’s get this sorted out quickly. The errors you’re seeing are straightforward: TensorFlow GPU 1.7.0 and TensorBoard need specific versions of numpy, six, and werkzeug that aren’t present in your virtual environment yet. Here’s what to do:
Step 1: Confirm your Virtualenv is active
First, double-check you’ve activated your virtual environment (it’s super easy to forget this and end up installing packages globally!). Run this in your terminal:
source /path/to/your/virtualenv/bin/activate
You’ll know it’s active when you see the virtualenv name in parentheses at the start of your terminal prompt.
Step 2: Upgrade Pip first (critical!)
Older Pip versions often struggle to resolve complex dependency chains properly. Let’s fix that first:
pip install --upgrade pip
Step 3: Install the required dependencies explicitly
Install the exact versions TensorFlow 1.7.0 requires with this command:
pip install numpy>=1.13.3 six>=1.10.0 werkzeug>=0.11.10
This makes sure all missing dependencies are in place before we install TensorFlow.
Step 4: Install TensorFlow GPU 1.7.0
Now that dependencies are sorted, install TensorFlow GPU:
pip install tensorflow-gpu==1.7.0
If you still hit issues (Anaconda-specific note)
Since you’re using Anaconda as your base Python, there’s a small chance Pip might conflict with Conda’s package management. If the above steps don’t work, try installing dependencies via Conda first (still within your activated Virtualenv):
conda install numpy=1.13.3 six=1.10.0 werkzeug=0.11.10
Then repeat the TensorFlow GPU install command.
That should clear up those dependency errors and let you install TensorFlow GPU successfully!
内容的提问来源于stack exchange,提问作者HF1

