I am trying to install tensorflow-gpu for python 3. when I run pip3:

sudo -H apt-get pip3 install tensorflow-gpu

I get:

Traceback (most recent call last:)
 File "/usr/local/bin/pip3", line 5, in <module>
  from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
  • You have typo in apt-get pip3 install tensorflow-gpu - it should be pip3 install tensorflow-gpu. Try to follow official documentation.
    – N0rbert
    Feb 14, 2018 at 17:00

3 Answers 3


pkg_resources is a dependency of setuptools. Open the terminal and type:

sudo apt install --reinstall python3-pkg-resources python3-setuptools

You might be better off using python3 instead of python. And I found these instructions the codakid.com website.

python3 -m pip install -U pygame==1.9.6 --user

It's also related to pip installation module. You can also use python upgrade scripts. Related issue on GitHub : import error Issue ‘s about wrong importation from python 2.x modules versions which overlap with python3 dependencies. So the goal’s to upgrade pip. The best solution’s to install an upgraded OS for instance Bionic distribution and Do:

pip3 install --upgrade setuptools pip
  • 1
    Hello and welcome to AU. Could you summarize the content of the link you refer to, so that your answer reamins valid even if the linked page disappears? Mar 12, 2020 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.