0

been trying to install the Send2Trash module for python with pip, but so far with no success. so i punched in pip install Send2Trash into the terminal and what i got was:

Collecting Send2Trash
  Using cached Send2Trash-1.3.0.tar.gz
Could not import setuptools which is required to install from a source distribution.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 377, in setup_py
    import setuptools  # noqa
  File "/usr/share/python-wheels/setuptools-20.7.0-py2.py3-none-any.whl/setuptools/__init__.py", line 11, in <module>
    from setuptools.extern.six.moves import filterfalse, map
  File "/usr/share/python-wheels/setuptools-20.7.0-py2.py3-none-any.whl/setuptools/extern/__init__.py", line 1, in <module>
    from pkg_resources.extern import VendorImporter
ImportError: No module named 'pkg_resources.extern'

You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

unrelated note, i also tried to update pip and it just installed 7.1.0 again. this is the first time using pip, so it might be a real newbe mistake...

2 Answers 2

0

First upgrade pip with the command sudo pip install --upgrade pip.

If the upgrade is successful (a message will show), then install the send2trash package, again with the sudo command, as so sudo pip install send2trash. That should get the job done.

1
  • don't use sudo with pip
    – virtualxtc
    Aug 27, 2018 at 23:03
0

As mulanLA mentions, your error is likely because you should upgrade pip. However, you shouldn't be using sudo when upgrading pip.

Once you've upgraded pip you may still get a error: could not create '/usr/local/lib/python2.7/dist-packages/send2trash': Permission denied message when attempting to install Send2Trash. To get around this install with the --user flag:

pip install --upgrade pip
pip install Send2Trash --user

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .