| Issue 4: | setup.py install --prefix does not create directories and requires root privileges | |
| 2 people starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
Setup.py install
* does not create necessary installation directories in prefix path
* requires write access to system-wide /usr/lib/python2.5/site-packages
even when installing to a user-writable prefix
* is likely to interfere with package manager (due to writing to /usr/lib)
Prefix directory is user-writable (/usr/local/stow). Usually I install
manually built packages there and deploy them with GNU stow. It works for
most of the python packages I have built this was. It does not work for
funcparserlib-0.3.3
Installation log:
funcparserlib-0.3.3$ python setup.py build
...
funcparserlib-0.3.3$ python setup.py install
--prefix=/usr/local/stow/funcparserlib-0.3.3
running install
Checking .pth file support in
/usr/local/stow/funcparserlib-0.3.3/lib/python2.5/site-packages/
error: can't create or remove files in install directory
... [ long explanations follow and suggest to create target directory ]
If I create
/usr/local/stow/funcparserlib-0.3.3/lib/python2.5/site-packages/ manually,
install terminates with an error reporting that prefix is not on PYTHONPATH.
If I define PYTHONPATH, install still terminates with:
error: could not create 'build/bdist.linux-i686/egg': Permission denied
Then I install it like (I don't like to do it under sudo, but it seems it
requires write access to /usr/lib anyway):
funcparserlib-0.3.3$ sudo
PYTHONPATH=/usr/local/stow/funcparserlib-0.3.3/lib/python2.5/site-packages/
python setup.py install --prefix=/usr/local/stow/funcparserlib-0.3.3
running install
... [ skipping ]
creating build/bdist.linux-i686/egg
I think `setup.py install --prefix=anyprefix` should not write anywhere
outside of `anyprefix`. I think it should create all necessary directories
automatically.
Debian/Lenny, Python 2.5.2, Setuptools 0.6c8-4
|
||||||||||||||
,
Sep 09, 2009
First of all, thanks for this detailed description. Interestingly enough, I don't use anything special in the install script (except of using `setuptools`, not just `distutils`). As far as I know, my `setup.py` is quite standard. I tried a `distutils` project `mercurial` and it worked as you wanted. But `simplejson` that used `setuptools` actually failed the same way you described. Could you specify a couple of links to projects that do the right thing for you? I definitely agree that `python setup.py install --prefix=foo` must write files under `foo` only. But it seems to me that the problem here is not with _install_, but with _build_ command. The directory you are building the library from must be writable in order to perform the build. So please check your permissions under the build directory once again. I repeated the steps you described (`mkdir` and `PYTHONPATH` done manually) and I didn't need root privileges.
Status: Started
|
|||||||||||||||
,
Sep 11, 2009
(No comment was entered for this change.)
Owner: andrey.vlasovskikh
|
|||||||||||||||
,
Oct 05, 2009
I've just tried django (svn), it uses distutils and installs with --prefix without a problem. As far as I remember I used to install at least Biopython, xlrd and FiPy the same way (probably all of them use distutils). |
|||||||||||||||
,
Oct 05, 2009
For this library its just fine to use the standard `distutils` so I've switched to it from `setuptools`. (Although it seems to me at this moment that using `pip` instead of `easy_install` is not a good idea).
Status: Fixed
|
|||||||||||||||
,
Oct 05, 2009
(No comment was entered for this change.)
Labels: Component-Scripts
|
|||||||||||||||
,
Oct 06, 2009
(No comment was entered for this change.)
Status: Verified
|
|||||||||||||||
,
Oct 06, 2009
(No comment was entered for this change.)
Labels: Milestone-0.3.4
|
|||||||||||||||
|
|
|||||||||||||||