You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the miniconda image, the base environment is re-configured if an environment.yml file is found. Installing a different Python version via this conda environment config file breaks pipx and other utilities under /usr/local/py-utils, making it difficult to fix and causing silent failures (see devcontainers/features#785):
$ pipx
Traceback (most recent call last):
File "/usr/local/py-utils/bin/pipx", line 5, in <module>
from pipx.main import cli
ModuleNotFoundError: No module named 'pipx'
The README notes the following instructions to fix pipx when a different Python version is installed:
However this will still fail because the broken pipx binary still has precedence on PATH. A more reliable process, similar to that used by the Python feature itself, is to install a temporary copy of pipx and then use it to fix all the sandboxes:
# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* requirements.txt .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp
# reinstall all pipx environments, in case Conda's base Python version changed
RUN export PYTHONUSERBASE=/tmp/pip-tmp PIP_CACHE_DIR=/tmp/pip-tmp/cache \
&& pip3 install --disable-pip-version-check --no-cache-dir --user pipx \
&& /tmp/pip-tmp/bin/pipx reinstall-all \
&& rm -rf /tmp/pip-tmp
When using the miniconda image, the
base
environment is re-configured if anenvironment.yml
file is found. Installing a different Python version via this conda environment config file breakspipx
and other utilities under/usr/local/py-utils
, making it difficult to fix and causing silent failures (see devcontainers/features#785):The README notes the following instructions to fix pipx when a different Python version is installed:
However this will still fail because the broken pipx binary still has precedence on PATH. A more reliable process, similar to that used by the Python feature itself, is to install a temporary copy of pipx and then use it to fix all the sandboxes:
Example
environment.yml
:The text was updated successfully, but these errors were encountered: