Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Carl Meyer Newsgroups: comp.lang.python Subject: Re: Python 3 virtualenvs Date: Mon, 30 Nov 2015 09:32:27 -0700 Lines: 117 Message-ID: References: <1mekmrs.1xn5n6010b7a1xN%real-not-anti-spam-address@apple-juice.co.uk> <1mem3lu.1327fd91org8tkN%real-not-anti-spam-address@apple-juice.co.uk> <8737vp0zh9.fsf@metapensiero.it> <201511291412.tATECKN8006265@fido.openend.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qsQ1MVdlnM085enxchQ9n4DlwTavp1SUp" X-Trace: news.uni-berlin.de EiHpLGhcYR3XpOR0NvauFwTXylkCrwSInZOOrILy6c5w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'error:': 0.05; 'fixes': 0.05; 'modified': 0.05; 'distributing': 0.07; 'exit': 0.07; 'ugly': 0.07; 'creighton': 0.09; 'bug': 0.10; 'python': 0.10; ':-)': 0.12; '(at': 0.13; 'useful,': 0.13; 'interpreter': 0.15; '(thank': 0.16; '3.3,': 0.16; 'accordingly': 0.16; 'dedication': 0.16; 'downstream': 0.16; 'expect,': 0.16; 'filename:fname piece:signature': 0.16; 'from:addr:carl': 0.16; 'hacks': 0.16; 'maintainers': 0.16; 'received:173.255': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'laura': 0.18; 'hack': 0.18; 'all,': 0.20; 'versions': 0.20; 'preferred': 0.20; 'fix': 0.21; 'do.': 0.22; 'meant': 0.22; '2.x': 0.22; 'either.': 0.22; 'environments': 0.22; 'maintains': 0.22; 'ones.': 0.22; 'users,': 0.22; 'am,': 0.23; 'originally': 0.23; 'third-party': 0.23; 'header:In-Reply-To:1': 0.24; 'all.': 0.24; 'url:bugs': 0.24; 'module': 0.25; 'install': 0.25; 'header:User- Agent:1': 0.26; "doesn't": 0.26; 'command': 0.26; 'linux': 0.26; 'error': 0.27; '(e.g.': 0.27; 'least': 0.27; 'turns': 0.27; 'this.': 0.28; "skip:' 10": 0.28; 'fine': 0.28; 'towards': 0.28; 'looks': 0.29; 'away.': 0.29; 'does,': 0.29; 'filed': 0.29; 'that.': 0.30; 'you?': 0.30; 'code': 0.30; 'minimal': 0.30; 'fixed': 0.31; 'everyone': 0.31; 'plans': 0.32; 'returned': 0.32; 'point': 0.33; 'useful': 0.33; 'url:python': 0.33; 'legacy': 0.33; 'maintaining': 0.34; 'previous': 0.34; 'done': 0.35; 'configured': 0.35; 'requiring': 0.35; 'level': 0.35; "isn't": 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'there': 0.36; 'url:org': 0.36; '(and': 0.36; 'modules': 0.36; 'projects.': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'seem': 0.37; 'doing': 0.38; 'virtual': 0.38; 'version': 0.38; 'building': 0.38; 'several': 0.38; 'mean': 0.38; 'why': 0.39; 'sure': 0.39; 'whatever': 0.39; "didn't": 0.39; 'enough': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'your': 0.60; 'hope': 0.61; 'provide': 0.61; 'personally': 0.61; 'real': 0.62; 'charset:windows-1252': 0.62; 'course': 0.62; 'more': 0.63; 'different': 0.63; 'believe': 0.66; 'better.': 0.66; 'today.': 0.67; 'day': 0.67; 'future,': 0.70; '(also,': 0.84; 'atop': 0.84; 'message).': 0.84; 'non-zero': 0.84; 'piled': 0.84; 'pip': 0.84; 'presumably': 0.84; 'using.': 0.84 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: <201511291412.tATECKN8006265@fido.openend.se> X-Spam-Status: No (score -1.0): ALL_TRUSTED=-1, URIBL_BLOCKED=0.001 X-Spam-Bar: - X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99742 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qsQ1MVdlnM085enxchQ9n4DlwTavp1SUp Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Laura, On 11/29/2015 07:12 AM, Laura Creighton wrote: > pyenv is going away. python -m venv is the preferred way to get a venv= >=20 > https://bugs.python.org/issue25154 >=20 > Of course if you try it, you may get: >=20 > Error: Command '['/bin/python3.4', '-Im', 'ensurepip', '--= upgrade', '--default-pip']' returned non-zero exit status 1 >=20 > which turns out to mean: >=20 > Your Python isn't configured with ensure-pip! AFAIK "isn't configured with ensurepip" is a thing which is only done to Python by some downstream distributors (e.g. Linux packagers). If they remove ensurepip, it should be their responsibility to also fix the venv module accordingly (at least enough to provide a useful error message). So I believe that's a bug that should be filed against whoever is distributing the Python you're using. > Right now, I personally don't know why there is a venv at all. Because virtualenv is an ugly hack which is difficult to maintain (I should know, I used to maintain it). In order to work at all, virtualenv maintains its own patched copy of several stdlib modules (based originally on Python 2.4(?) and modified since then) and uses them instead of the version distributed with whatever version of Python you are using. Some other stdlib modules it monkeypatches. As you might expect, this regularly causes problems when new Python versions are released, requiring even more hacks piled atop the previous ones. It's a real testament to the dedication of the current virtualenv maintainers (thank you, PyPA!) that it even works at all. The built-in venv module in Python 3.3+ fixes that by building a minimal level of support for virtual environments directly into the Python interpreter and stdlib, removing the need for (monkey)patching. Of course that interpreter support isn't available in Pythons prior to 3.3, which is why virtualenv remains much more popular today. (Also, the first version of venv in Python 3.3 didn't automatically install pip into the envs, which made them less useful, because at that point pip was a purely third-party project. That's been fixed with ensurepip in Python 3.4+). I very much hope that some day in the future, when all new Python projects are in Python 3, almost everyone will use venv, and virtualenv will be relevant only to those maintaining legacy Python 2 projects. There has been some work towards writing a transitional version of virtualenv that looks the same to users, but (under the hood) uses the old code only for 2.x and uses venv for Python 3. > Despite > the similarity of names, it doesn't seem to be about doing what virtual= env > does. I don't know what you mean by this. Venv is intended to do _exactly_ what virtualenv does, only better. Unless by "what virtualenv does" you mean "also support Python 2." > I think it is only meant to be used by people who want to install > packages but not site-wide, but I am not sure about that. I don't know what you mean by this either. Isn't the ability to "install packages but not site-wide" precisely what virtualenv (and venv) give you= ? > I don't think > there are any plans to give venv the functionality of virtualenv, What functionality do you mean? > so > presumably there are people who like it just fine the way it is now. > They must have very different needs than I do. I don't know, since you never said what it is about venv that doesn't meet your needs :-) Carl --qsQ1MVdlnM085enxchQ9n4DlwTavp1SUp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBCAAGBQJWXHoiAAoJEC0ft5FqUuEhTFcP/AwzV92tXE4EwiuCCZlMYV69 iL14L3wEEippItdteIZtFgrjwmZT/yTnz6YKg8lK0mhrdxfwGVN5Fk/L5yC7ZnIq hMvlLw4DpKsfgEy8FMHu4Q0v6WpyVG7kW0Oee7SMYH+cSa3KfgAss9+7kTVoY6es nfoOHlyu2Atux+/PUIK/Mi7EYF5G26CKakogMfG7HHOHdOlGx325hj6Toom7ybgi 7tyvzQSGQEbXKNOpR9795DW2/DoK0edpGlQWAoctl7tFsfDVh48m+f7fAG9+ZOm6 /a8cvAaJF6+jqcUEm65/Yt9JZDjzoqcLK80HfFAmD+AZxeYNXpv/kFQY8rBaNAW1 GvOqSHPOJZrm15twwQQjdd0w5iYEv0IeHH4JAL1nKNP77ZN6DlSChVMsKr+eOyXb dfvoFau0f4K/rHZ7I1Y3kaUeCQBpAM5oZXq9KU/M4l5u+rs4lAd4hlw4lfc0tRfb Anema2IsHhSNbVs1cNQ3TNd26H1Foa8sO1xf4amMwvyXBC3ke/OTPmINDWY/TKhM IWi4TnuKKpj+VaLBwTMSIJr1GGsf88O066YsMRxM+GwpiHYhvKX5hgoH06QVuGb/ Tp+0crbFX7Am8PaL2J87ELa7TOy2xomoFYrVST7ux91uKKa1ulZS7aqx8k6eD1N6 I87betPZ19DvaKe1KXdx =3rxa -----END PGP SIGNATURE----- --qsQ1MVdlnM085enxchQ9n4DlwTavp1SUp--