View Issue Details

IDProjectCategoryView StatusLast Update
0004385Talerobsolete componentpublic2016-04-09 01:50
ReporterChristian Grothoff Assigned ToFlorian Dold  
PriorityimmediateSeverityblockReproducibilityhave not tried
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Version0.0 
Target Version0.0Fixed in Version0.0 
Summary0004385: can't run 'make install' for bank because it ignores prefix
DescriptionAfter running 'configure --prefix=/home/grothoff', I get:

$ make install
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-32086.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python2.7/dist-packages/

Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.

Makefile:25: recipe for target 'install' failed
make: *** [install] Error 1


This should not happen as with --prefix, it should install to /home/grothoff, not /usr.
TagsNo tags attached.

Activities

Marcello Stanisci

2016-04-08 11:17

reporter   ~0010413

With the new setup, --prefix only dictates where to put the final shell scripts.
Instead, all python files are installed by setuptools, which in your case tries to install them in the "system" directory (since, as it seems, you have no virtualenv active). So it requires superuser rights.

Yes, the virtualenv creation is not managed by configure/make anymore, but we preferred to cut off the "acrobatics" needed to activate virtualenv on behalf of the user..

Florian Dold

2016-04-08 11:56

manager   ~0010415

That's a bit odd. If we just use setuptools, then we should also use that to install the shell scripts.

And setup.py does, per default, support --prefix.

Christian Grothoff

2016-04-08 21:22

manager   ~0010417

Installation still fails with --prefix. First, pip3 doesn't recognize --prefix, using http://stackoverflow.com/questions/25333640/pip-python-differences-between-install-option-prefix-and-root-and I fixed it by adding --install-option around it in c171168..4a9a81c.

Now it recognizes the option, but 'make install' still fails:

Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 295, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 214, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 204, in clobber
    os.makedirs(destdir)
  File "/usr/lib/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/validictory-1.0.1.dist-info'

Storing debug log for failure in /home/grothoff/.pip/pip.log
Makefile:30: recipe for target 'install' failed


Did you ever test this?

Christian Grothoff

2016-04-08 21:28

manager   ~0010418

Tried replacing --prefix with --target, result is that it basically trashed my $HOME with a crapload of Python garbage. Also, 'make install' re-downloads a metric shitload of dependencies each time. Not acceptable.

Please make sure:
1) configure checks for Python.h properly
2) configure --prefix works on Debian systems
3) no re-downloading of resources again and again each time there is some small failure in the end!

Christian Grothoff

2016-04-08 21:30

manager   ~0010419

And

4) if the thing installs stuff, it should be:
   $PREFIX/bin: the main two binaries
   $PREFIX/{lib,share}/{taler-bank/}-rest-of-the crap.

Florian Dold

2016-04-08 21:31

manager   ~0010420

See my recent mail about pip. Recent versions of pip support --prefix just fine, just not the ancient version that ships with debian.

Of course we should check that we have a recent-enough version of pip, but that's not trivial with autoconf.

Florian Dold

2016-04-08 21:34

manager   ~0010421

Binaries are already installed in $PREFIX/bin, the rest is installed in $PREFIX/lib.

And no, "make install" does not re-download dependencies. The ancient debian version might, but recent ones don't.

Florian Dold

2016-04-08 21:37

manager   ~0010422

See https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption--prefix

Christian Grothoff

2016-04-08 21:37

manager   ~0010423

I now tried with Debian unstable, pip 8.1.1. Result:

$ pip3 install --prefix=/home/grothoff/ .
ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

Christian Grothoff

2016-04-08 21:37

manager   ~0010424

Also, if you require a very recent pip3, configure should test that the installed version is recent enough.

Florian Dold

2016-04-08 21:39

manager   ~0010425

Last edited: 2016-04-08 21:40

It should be

$ cd taler/bank # where our setup.py is
$ pip3 install . --prefix=/home/grothoff/

(note the dot, i.e. install the package defined in the current directory).

And yes, we should check for a recent enough version. Again, please see my email about difficulties with this.

Christian Grothoff

2016-04-08 21:43

manager   ~0010426

Makes no difference:

grothoff@spec:~/research/taler-bank$ pip3 install . --prefix=/home/grothoff/
ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

Florian Dold

2016-04-08 21:52

manager   ~0010427

This is very weird (you're obviously not specifying the user configuration).

Could this be an issue with a broken configuration somewhere, similar to [1]?

I'm trying to reproduce this, but both in my machine (Arch) and on tripwire inside a virtualenv it just works ...

[1] http://stackoverflow.com/q/4495120

Florian Dold

2016-04-08 21:55

manager   ~0010428

A workaround for now would be to install it with just --user.

Python generally does not seem to play well with an arbitrary prefix it seems.

Florian Dold

2016-04-08 22:25

manager   ~0010429

Even when installing python3-pip on tripwire and upgrading it (pip3 install -U pip) I can't reproduce it, so it works inside and outside of virtualenvs.

No idea what's going wrong here ...

Florian Dold

2016-04-08 23:01

manager   ~0010430

Could you please try running

$ pip3 install . --prefix=/home/grothoff/ --isolated

from the root of the bank repository?

This should prevent any bad configuration files from e.g. adding "--user" as the default that messes with --prefix.

Christian Grothoff

2016-04-09 00:01

manager   ~0010431

grothoff@spec:~/research/taler-bank$ pip3 install . --prefix=/tmp/grothoff --isolated
ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

Florian Dold

2016-04-09 01:06

manager   ~0010432

This has to be a configuration problem. It works from a fresh install:

dold@fdold ~> docker run -i -t debian:unstable /bin/bash
root@3559332d9aa4:/# apt-get update && apt-get install -y python3-pip python3-setuptools git vim autoconf libpq-dev
root@3559332d9aa4:/# git clone git://taler.net/bank
root@3559332d9aa4:/# cd bank/
root@3559332d9aa4:/bank# ./bootstrap && ./configure --prefix=/home/foo
root@3559332d9aa4:/bank# pip3 install . --prefix=/home/foo
[...]
Successfully installed django django-simple-math-captcha psycopg2 requests setproctitle talerbank uWSGI validictory

Florian Dold

2016-04-09 01:08

manager   ~0010433

Same for debian:jessie, except that

$ pip3 install -U pip

must be run first.

Christian Grothoff

2016-04-09 01:11

manager   ~0010434

Yes, with that magic incantation it works. Needs to be added to README...

Florian Dold

2016-04-09 01:12

manager   ~0010435

So what did you change? I thought that you said above that you ran exactly that command, and it failed?

Christian Grothoff

2016-04-09 01:17

manager   ~0010436

Running "pip3 install -U pip" first helped...

Florian Dold

2016-04-09 01:44

manager   ~0010437

So this seems fixed then. I've also added a check for pip>=8.1.1.

Issue History

Date Modified Username Field Change
2016-04-07 23:03 Christian Grothoff New Issue
2016-04-07 23:03 Christian Grothoff Status new => assigned
2016-04-07 23:03 Christian Grothoff Assigned To => Marcello Stanisci
2016-04-08 11:17 Marcello Stanisci Note Added: 0010413
2016-04-08 11:56 Florian Dold Note Added: 0010415
2016-04-08 17:10 Florian Dold Status assigned => resolved
2016-04-08 17:10 Florian Dold Resolution open => fixed
2016-04-08 17:10 Florian Dold Assigned To Marcello Stanisci => Florian Dold
2016-04-08 20:42 Christian Grothoff Status resolved => closed
2016-04-08 20:42 Christian Grothoff Fixed in Version => 0.0
2016-04-08 21:22 Christian Grothoff Note Added: 0010417
2016-04-08 21:22 Christian Grothoff Status closed => assigned
2016-04-08 21:28 Christian Grothoff Note Added: 0010418
2016-04-08 21:30 Christian Grothoff Note Added: 0010419
2016-04-08 21:31 Christian Grothoff Priority high => immediate
2016-04-08 21:31 Florian Dold Note Added: 0010420
2016-04-08 21:34 Florian Dold Note Added: 0010421
2016-04-08 21:37 Florian Dold Note Added: 0010422
2016-04-08 21:37 Christian Grothoff Note Added: 0010423
2016-04-08 21:37 Christian Grothoff Note Added: 0010424
2016-04-08 21:39 Florian Dold Note Added: 0010425
2016-04-08 21:40 Florian Dold Note Edited: 0010425
2016-04-08 21:43 Christian Grothoff Note Added: 0010426
2016-04-08 21:52 Florian Dold Note Added: 0010427
2016-04-08 21:55 Florian Dold Note Added: 0010428
2016-04-08 22:25 Florian Dold Note Added: 0010429
2016-04-08 23:01 Florian Dold Note Added: 0010430
2016-04-08 23:01 Florian Dold Status assigned => feedback
2016-04-09 00:01 Christian Grothoff Note Added: 0010431
2016-04-09 00:01 Christian Grothoff Status feedback => assigned
2016-04-09 01:06 Florian Dold Note Added: 0010432
2016-04-09 01:08 Florian Dold Note Added: 0010433
2016-04-09 01:11 Christian Grothoff Note Added: 0010434
2016-04-09 01:12 Florian Dold Note Added: 0010435
2016-04-09 01:17 Christian Grothoff Note Added: 0010436
2016-04-09 01:44 Florian Dold Note Added: 0010437
2016-04-09 01:44 Florian Dold Status assigned => resolved
2016-04-09 01:50 Christian Grothoff Status resolved => closed
2022-08-23 20:26 Christian Grothoff Category bank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 01:23 Christian Grothoff Category py bank (demonstrator, obsolete) => obsolete componet
2023-12-11 20:08 Florian Dold Category obsolete componet => obsolete component