Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #93643
| References | <3mSGXb0tfQzFpW3@dovecot04.posteo.de> <CAMw+j7+hUvj0-T4AoqG4X2RB6XUP4U0Unf=q2M8wT1_BEWKiZA@mail.gmail.com> <3mScQ36NW9zFpW6@dovecot04.posteo.de> |
|---|---|
| Date | 2015-07-10 16:49 +0200 |
| Subject | Re: [setuptools] install data-file in users home-dir |
| From | Chris Warrick <kwpolska@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.399.1436539796.3674.python-list@python.org> (permalink) |
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
Re: [setuptools] install data-file in users home-dir Chris Warrick <kwpolska@gmail.com> - 2015-07-10 16:49 +0200
csiph-web