0

When I run pip install fasteners, it shows

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: fasteners in ./.local/lib/python3.6/site-packages (0.15)
Requirement already satisfied: six in ./.local/lib/python3.6/site-packages (from fasteners) (1.15.0)
Requirement already satisfied: monotonic>=0.1 in ./.local/lib/python3.6/site-packages (from fasteners) (1.5)

The package is installed in ./.local/lib/python3.6/site-packages.

But I want to install it in /usr/bin/python2/site-packages ,

because duplicity uses python2 . And on running duplicity --version i get could not import fasteners error

aahnik
  • 1,661
  • 1
  • 11
  • 29

2 Answers2

1

Try the following command to install fasteners for Python 2.7:

sudo python2.7 -m pip install fasteners

if you get No module named pip error, try:

sudo python2.7 -m ensurepip --default-pip

then try installing fasteners again.

Nathan Mills
  • 2,243
  • 2
  • 9
  • 15
  • I tried but didn't work. Some other errors occurred. Please see full output [here](https://gist.github.com/aahnik/9eab599c9c2158b2ae90df57f99de9f5#file-terminal_pip_python2-md) – aahnik Oct 03 '20 at 03:53
  • 1
    Please try `sudo python2.7 -m pip uninstall pip` then installing pip with your package manager. The package might be called `python2-pip` or `python-pip`. If that doesn't work, you can try installing openssl development package and compiling python against it. – Nathan Mills Oct 04 '20 at 01:37
  • Thanks a lot for help. I fixed the problem by removing python and having a fresh install. I had many some mistakes while installing python from source code. You were right. Actually many packages were missing – aahnik Oct 04 '20 at 15:16
1

As shared by you in comment section of @Nathan Mills's answer you are getting SSL error. I think you are missing some of the libs. Try by installing below libraries and try again with the command you were using.

sudo apt-get install build-essential checkinstall 
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Then :

sudo python2.7 -m pip install fasteners

Try :

sudo python2.7 -m pip install --index-url=http://pypi.python.org/simple/ fasteners
EduardoSaverin
  • 545
  • 4
  • 19
  • i tried your answer. didnt work please [see output](https://gist.github.com/aahnik/9eab599c9c2158b2ae90df57f99de9f5#gistcomment-3475676) – aahnik Oct 03 '20 at 05:09