Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #93643

Re: [setuptools] install data-file in users home-dir

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <kwpolska@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'yet.': 0.03; 'modify': 0.04; 'correct.': 0.07; 'subject:file': 0.07; 'cc:addr:python-list': 0.09; '(use': 0.09; 'here?': 0.09; 'messing': 0.09; 'packages.': 0.15; 'chris,': 0.16; "skip:' 60": 0.16; 'subject:home': 0.16; 'subject:install': 0.16; 'sudo': 0.16; 'system-wide': 0.16; 'url:setuptools': 0.16; 'wrote:': 0.16; 'config': 0.18; 'script.': 0.18; 'subject:] ': 0.19; 'versions': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'permission': 0.20; 'cc:no real name:2**0': 0.22; 'errors': 0.23; 'header:In-Reply-To:1': 0.24; 'testing': 0.25; 'install': 0.25; 'sense': 0.26; 'chris': 0.26; 'separate': 0.27; 'message- id:@mail.gmail.com': 0.27; 'package.': 0.27; 'correct': 0.28; "skip:' 10": 0.28; 'regular': 0.29; 'subject:users': 0.29; 'sure,': 0.29; 'environment': 0.29; 'that.': 0.30; 'maybe': 0.33; 'instead,': 0.33; 'skip:/ 20': 0.33; 'file': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'dir': 0.35; 'exist': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'things': 0.38; 'skip:p 20': 0.38; 'thank': 0.38; 'mailing': 0.38; 'files': 0.38; 'mean': 0.38; 'data': 0.39; 'does': 0.39; 'system.': 0.39; 'subject:-': 0.39; 'your': 0.60; 'skip:u 10': 0.61; 'default': 0.61; 'different': 0.63; 'other.': 0.64; 'future.': 0.67; 'user,': 0.67; 'production': 0.67; 'reply': 0.68; 'answer.': 0.72; 'friendly': 0.74; '--user': 0.84; 'pip': 0.84; 'wheel': 0.84; 'glad': 0.87
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=9iwsYUqVfPhM1XQmKcTdaGmuQKvzlbVLv9BFS4c4of8=; b=AlF1avmZT7fZvPrPTpOCXbH8boNV5gO/Z03lTi3FS91JTiH4g5WZcOjbyu0Ls7MQdj NuomZ80hwpQabFipw/gyCevd4XUFZmRqVqRSCUGww8nRCX3Kr2iWECRyZsdm+n2jLlSo LSbgmMJZ+iOJyQ5dRGYv43V1xU9Ipo8JKKP2ZD2Z44GKoLgBMJPhswFABqPoXRHSmZ3V fRNQPtNhQ7Gep+kbGAN5VoO0ci2+izBoc1Iw1EnCTsQsQkREawKFdD94lE3GLR0PsmB1 Oz/IIJBrcQKJq5Ee1utx9FnTlFH+yxc9pDYqZiV30K0jhuRzMfi0u2uF3HtCSP7O5aFU EsqQ==
MIME-Version 1.0
X-Received by 10.112.219.70 with SMTP id pm6mr19780401lbc.41.1436539789384; Fri, 10 Jul 2015 07:49:49 -0700 (PDT)
In-Reply-To <3mScQ36NW9zFpW6@dovecot04.posteo.de>
References <3mSGXb0tfQzFpW3@dovecot04.posteo.de> <CAMw+j7+hUvj0-T4AoqG4X2RB6XUP4U0Unf=q2M8wT1_BEWKiZA@mail.gmail.com> <3mScQ36NW9zFpW6@dovecot04.posteo.de>
Date Fri, 10 Jul 2015 16:49:49 +0200
Subject Re: [setuptools] install data-file in users home-dir
From Chris Warrick <kwpolska@gmail.com>
To c.buhtz@posteo.jp
Cc python-list@python.org
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.399.1436539796.3674.python-list@python.org> (permalink)
Lines 61
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1436539796 news.xs4all.nl 2918 [2001:888:2000:d::a6]:44140
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:93643

Show key headers only | View raw


CC’ing the mailing list; please use Reply All in the future.

On 10 July 2015 at 16:36,  <c.buhtz@posteo.jp> wrote:
> Hi Chris,
>
> thank you for your answer.
>
> On 2015-07-10 09:39 Chris Warrick <kwpolska@gmail.com> wrote:
>> You should NEVER use sudo with pip.  Instead, use virtualenvs as a
>> regular user, or create your own .deb packages.
>
> I am not sure, but maybe this is an Ubuntu-specific "problem"?
> When I don't use sudo I got errors like this
> "PermissionError: [Errno 13] Permission denied:
> '/usr/local/lib/python3.4/dist-packages/SQLAlchemy-1.0.6.dist-info"
>
> And it make sense for me.

This is correct.  Don’t install things system-wide with pip.

> Don't tell me about deb-Packages! :D I am stuck with that currently. I
> would be glad to have a correct working whl-file for my local needs.
> After that - maybe! - I will start again with thinking about a deb.
>
> How can virtualenv help here? I need to install
> python-software/packages to the system and not to a different
> environment or sandbox.
> I never used virtualenv but as I understand it it is for testing
> purpose not for productive system.

virtualenv should be used for both testing AND production
environments. Your projects can have different versions of
dependencies, and this is what virtualenv helps with: they are
separate from each other. You can also modify the system packages
without messing with your system packages.

You can also use pip install --user to install to ~/.local

>> And you should not create the files in your install script.  Instead,
>> install them to a different data dir (somewhere in 'share/appname'
>
> What do you mean with "data dir"? For a default config-file it could
> be /etc/appname/default.conf. But I have no rights for that.

https://pythonhosted.org/setuptools/setuptools.html#including-data-files

Makes your package installable through wheel files and friendly for
all environments.

>> should copy this file to user’s config directory (use pkg_resources to
>> help you get it) if it does not exist yet.
>
> I will look at this package.

https://pythonhosted.org/setuptools/setuptools.html#accessing-data-files-at-runtime

-- 
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: [setuptools] install data-file in users home-dir Chris Warrick <kwpolska@gmail.com> - 2015-07-10 16:49 +0200

csiph-web