Chris's Wiki :: blog/python/PipPythonVersionIssue Commentshttps://utcc.utoronto.ca/~cks/space/blog/python/PipPythonVersionIssue?atomcommentsDWiki2020-10-29T16:08:54ZRecent comments in Chris's Wiki :: blog/python/PipPythonVersionIssue.By wilbur on /blog/python/PipPythonVersionIssuetag:CSpace:blog/python/PipPythonVersionIssue:727f3edb305f249499e6375db969ff5412c4791awilbur<div class="wikitext"><p>This has also annoyed me in the past! FWIW, setting the env var PYTHONUSERBASE will override the default value for `site.USER_BASE`:</p>
<pre>
$ PYTHONUSERBASE=/tmp/my-user-base python3 -m pip install --user black
...
$ ls /tmp/my-user-base/bin/
black black-primer blackd
</pre>
</div>2020-10-29T16:08:54ZBy rwoodsmall on /blog/python/PipPythonVersionIssuetag:CSpace:blog/python/PipPythonVersionIssue:b424ae636c6cbf479d537226ba9cf274ab759f70rwoodsmall<div class="wikitext"><p>There are two options:</p>
<p>- use a virtualenv/venv in your home directory and risk it becoming out of date
- compile your own Python, again in your home directory or some shared location</p>
<p>"System" Python is just that, and basically only fit for that purpose - think yum, bits of dnf, etc. From a developer perspective, you have to own your Python install, and that means either fully utilizing the package manager or not using it at all. There's not really a comfortable space in between.</p>
</div>2020-10-28T21:29:35ZBy Chris Siebenmann on /blog/python/PipPythonVersionIssuetag:CSpace:blog/python/PipPythonVersionIssue:d3e135d1b8726d22bc56f6713e5f460d086b4360Chris Siebenmann<div class="wikitext"><p>The problem with <code>pip list --user</code> is that you need to know in advance
that you need to record your package list. Once the upgrade has happened,
it's too late; the new version of Python and pip don't see your old
version's packages to list them, so you get to dig out the list by hand.</p>
</div>2020-10-28T17:52:14ZBy Leah Neukirchen on /blog/python/PipPythonVersionIssuetag:CSpace:blog/python/PipPythonVersionIssue:09b4c72719781f2a91c1e9d277054ed45de8eb5dLeah Neukirchenhttps://leahneukirchen.org/<div class="wikitext"><p><code>pip list --user</code> should list your packages, potentially combined with <code>--not-required</code> to get the manually installed packages only.</p>
<p>Renaming will only work if there are no binary libraries, updating a minor version of Python will require rebuilding those.</p>
</div>2020-10-28T11:46:33ZBy Albert on /blog/python/PipPythonVersionIssuetag:CSpace:blog/python/PipPythonVersionIssue:0889e0c7bf028cb50ad158bc66c813a348201ed8Albert<div class="wikitext"><p>The few times it happened to me, I just re-did pip install in the new environment and delete the old copies.</p>
</div>2020-10-28T09:49:29ZBy rjc on /blog/python/PipPythonVersionIssuetag:CSpace:blog/python/PipPythonVersionIssue:dc9cba68213d043e642081ace793015b74e23185rjc<div class="wikitext"><p>This is an issue we encounter time and time again and it is the very reason why the first thing we tell the students, apart from suggesting to use virtual environments, is to always be as explicit as possible and use:</p>
<pre>
python3.8 -m pip install --user foo
</pre>
<p>It'll work on both different machines (we use NFS) and on newer OS releases (Ubuntu 16.04+ LTS) - we use Python from "deadsnakes" PPA so at there are at least 4 Python 3 releases available to choose from.</p>
<p><a href="https://docs.python.org/3/installing/index.html#work-with-multiple-versions-of-python-installed-in-parallel">https://docs.python.org/3/installing/index.html#work-with-multiple-versions-of-python-installed-in-parallel</a></p>
</div>2020-10-28T07:39:09Z