0

Tried to install with pip:

user@Ubuntu ~/ $ sudo pip --no-cache-dir install --user -U setuptools
Requirement already up-to-date: setuptools in /home/coder/.local/lib/python3.5/site-packages (40.6.3)

But when I wanted to import it, then it's not importing anymore.

user@Ubuntu ~/ $ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named setuptools
>>>
martineau
  • 119,623
  • 25
  • 170
  • 301
Swapnil
  • 9
  • 4
  • Possible duplicate of [How do I access packages installed by \`pip --user\`?](https://stackoverflow.com/questions/38112756/how-do-i-access-packages-installed-by-pip-user) – metatoaster Jan 20 '19 at 22:47

1 Answers1

0

I got the solution for this from this link here Correct command for pip upgrade my solution is below:

User@Ubuntu ~/Documents/RE $ sudo python -m pip install --upgrade pip setuptools wheel

Requirement already up-to-date: pip in /home/coder/.local/lib/python2.7/site-packages (18.1)
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/37/06/754589caf971b0d2d48f151c2586f62902d93dc908e2fd9b9b9f6aa3c9dd/setuptools-40.6.3-py2.py3-none-any.whl (573kB)
    100% |████████████████████████████████| 573kB 666kB/s 
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
Installing collected packages: setuptools, wheel
Successfully installed setuptools-40.6.3 wheel-0.32.3

user@Ubuntu ~/Documents/RE $ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> 

So correct command was this:

user@ubuntu ~/Documents/RE $ sudo python -m pip install --upgrade pip setuptools wheel
Swapnil
  • 9
  • 4