• Best practise for managing Conda environments?

    From Martin Schöön@3:633/10 to All on Mon Sep 21 09:17:29 2026
    I am a occasional Python user and hence only post here rather seldom.
    Full time lurker though :-)

    I am a full time Linux user and moved from pip to conda for managing
    my Python life a few years ago. I am not an advanced conda user by
    any measure. For the most part moving to conda was a good idea.

    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment
    stalls at the 'solving environment' stage. I found a bunch of rather
    different 'fixes'. I have not tried any yet. I think maybe I am doing environments wrong.

    Among the 'fixes' suggested are:

    * Use mamba for installing packages.
    * conda config --set channel_priority strict
    * Remove and re-create environments to ensure packages are up-to-date.

    The last one was not stated explicitly. I created it by
    'interpreting' several posts that made me think I have done environments
    the wrong way.

    My thinking now:

    I should have more rather than fewer environments and make them more
    task specific -- avoid 'general purpose' environments to limit the
    number of packages in each environment.

    I have noticed that "conda update whatever" /always/ tells me everything
    is up-to-date. This can't be true. Will the procedure of the third
    bullet above solve this?

    No, I have not tried asking any LLM. I hope for some real human advice.

    TIA

    /Martin

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Mon Sep 21 17:32:32 2026
    On 9/21/2026 5:17 PM, Martin Sch””n wrote:
    I am a occasional Python user and hence only post here rather seldom.
    Full time lurker though :-)

    I am a full time Linux user and moved from pip to conda for managing
    my Python life a few years ago. I am not an advanced conda user by
    any measure. For the most part moving to conda was a good idea.

    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment
    stalls at the 'solving environment' stage. I found a bunch of rather different 'fixes'. I have not tried any yet. I think maybe I am doing environments wrong.

    Among the 'fixes' suggested are:

    * Use mamba for installing packages.
    * conda config --set channel_priority strict
    * Remove and re-create environments to ensure packages are up-to-date.

    The last one was not stated explicitly. I created it by
    'interpreting' several posts that made me think I have done environments
    the wrong way.

    My thinking now:

    I should have more rather than fewer environments and make them more
    task specific -- avoid 'general purpose' environments to limit the
    number of packages in each environment.

    I have noticed that "conda update whatever" /always/ tells me everything
    is up-to-date. This can't be true. Will the procedure of the third
    bullet above solve this?

    No, I have not tried asking any LLM. I hope for some real human advice.

    TIA

    /Martin

    Dear Martin,

    Sadly, I am completely unfamiliar with Conda, nor do I know anything
    about managing Python environments yet. So I only have a suggestion
    for the intermesso [0], and hopefully the wizards of comp.lang.python
    have a better answer.

    Have you considered installing the offending package using your opera-
    ting system package manager instead, if available as such? There are
    n+1 [1] Linux package managers, so I leave off any suggestions for the
    command line tool.


    Best wishes, and happy Python!

    [0] I simply presume someone is listening to music while we wait for the wizards to reply.

    [1] Somewhere, someone is coding a Linux package manager from scratch,
    hence if there are /n/ today, there will be /n+1/ tomorrow.
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via XS News https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Martin Schöön@3:633/10 to All on Mon Sep 21 20:33:53 2026
    Den 2026-09-21 skrev Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>:
    On 9/21/2026 5:17 PM, Martin Sch””n wrote:
    <snip>

    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment
    stalls at the 'solving environment' stage. I found a bunch of rather
    different 'fixes'. I have not tried any yet. I think maybe I am doing
    environments wrong.

    <snip>
    My thinking now:

    I should have more rather than fewer environments and make them more
    task specific -- avoid 'general purpose' environments to limit the
    number of packages in each environment.

    I have noticed that "conda update whatever" /always/ tells me everything
    is up-to-date. This can't be true. Will the procedure of the third
    bullet above solve this?

    No, I have not tried asking any LLM. I hope for some real human advice.

    Dear Martin,
    <snip>
    Have you considered installing the offending package using your opera-
    ting system package manager instead, if available as such? There are
    n+1 [1] Linux package managers, so I leave off any suggestions for the command line tool.

    I think this is how most or even all Linux users start with Python. Then,
    after a while you want to use a Python package (or version) not catered
    for by your system package manager...

    /Martin

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jon Ribbens@3:633/10 to All on Mon Sep 21 22:05:26 2026
    On 2026-09-21, Martin Sch””n <martin.schoon@gmail.com> wrote:
    Den 2026-09-21 skrev Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>:
    On 9/21/2026 5:17 PM, Martin Sch””n wrote:
    <snip>

    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment
    stalls at the 'solving environment' stage. I found a bunch of rather
    different 'fixes'. I have not tried any yet. I think maybe I am doing
    environments wrong.

    <snip>
    My thinking now:

    I should have more rather than fewer environments and make them more
    task specific -- avoid 'general purpose' environments to limit the
    number of packages in each environment.

    I have noticed that "conda update whatever" /always/ tells me everything >>> is up-to-date. This can't be true. Will the procedure of the third
    bullet above solve this?

    No, I have not tried asking any LLM. I hope for some real human advice.

    Dear Martin,
    <snip>
    Have you considered installing the offending package using your opera-
    ting system package manager instead, if available as such? There are
    n+1 [1] Linux package managers, so I leave off any suggestions for the
    command line tool.

    I think this is how most or even all Linux users start with Python. Then, after a while you want to use a Python package (or version) not catered
    for by your system package manager...

    Indeed. Using the operating system package manager for Python
    packages is only feasible if you yourself are creating a package
    for that operating system.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Tue Sep 22 14:37:06 2026
    On 9/22/2026 6:05 AM, Jon Ribbens wrote:
    On 2026-09-21, Martin Sch””n <martin.schoon@gmail.com> wrote:
    Den 2026-09-21 skrev Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>:
    On 9/21/2026 5:17 PM, Martin Sch””n wrote:
    <snip>

    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment
    stalls at the 'solving environment' stage. I found a bunch of rather
    different 'fixes'. I have not tried any yet. I think maybe I am doing
    environments wrong.

    <snip>
    My thinking now:

    I should have more rather than fewer environments and make them more
    task specific -- avoid 'general purpose' environments to limit the
    number of packages in each environment.

    I have noticed that "conda update whatever" /always/ tells me everything >>>> is up-to-date. This can't be true. Will the procedure of the third
    bullet above solve this?

    No, I have not tried asking any LLM. I hope for some real human advice. >>>>
    Dear Martin,
    <snip>
    Have you considered installing the offending package using your opera-
    ting system package manager instead, if available as such? There are
    n+1 [1] Linux package managers, so I leave off any suggestions for the
    command line tool.

    I think this is how most or even all Linux users start with Python. Then,
    after a while you want to use a Python package (or version) not catered
    for by your system package manager...

    Indeed. Using the operating system package manager for Python
    packages is only feasible if you yourself are creating a package
    for that operating system.

    Point taken. Now, what is worrying me, is the lack of answers about the
    Conda package manager. I was under the impression Usenet was full of
    Python coders [1], and someone would know what to do about the original problem.

    Is there really, in all of Usenet, nobody who knows how to solve this?


    [1] Because some people are always talking about Python in comp.lang.c,
    and comp.lang.lisp. No need to name them as they haven't commented in
    this discussion thread.
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via XS News https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Tue Sep 22 15:08:14 2026
    On 9/21/2026 5:17 PM, Martin Sch””n wrote:
    I am a occasional Python user and hence only post here rather seldom.
    Full time lurker though :-)

    I am a full time Linux user and moved from pip to conda for managing
    my Python life a few years ago. I am not an advanced conda user by
    any measure. For the most part moving to conda was a good idea.

    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment
    stalls at the 'solving environment' stage. I found a bunch of rather different 'fixes'. I have not tried any yet. I think maybe I am doing environments wrong.

    Among the 'fixes' suggested are:

    * Use mamba for installing packages.
    * conda config --set channel_priority strict
    * Remove and re-create environments to ensure packages are up-to-date.

    The last one was not stated explicitly. I created it by
    'interpreting' several posts that made me think I have done environments
    the wrong way.

    My thinking now:

    I should have more rather than fewer environments and make them more
    task specific -- avoid 'general purpose' environments to limit the
    number of packages in each environment.

    I have noticed that "conda update whatever" /always/ tells me everything
    is up-to-date. This can't be true. Will the procedure of the third
    bullet above solve this?

    No, I have not tried asking any LLM. I hope for some real human advice.

    TIA

    /Martin

    Dear Martin,

    The following is a quote from an email that I believe an A.I. agent sent
    me in an email, so you need to take it with a grain of salt.

    I have no idea if this is helpful. ------------------------------------------------------------------------
    Read the conda thread. The stall at 'solving environment' is almost
    always the solver, not the package. conda's classic solver gets much
    slower as the env grows; libmamba (libsolv) became the default in conda
    23.9, with roughly 50-80% improvements in Anaconda's own numbers. Check
    it with: conda config --show solver. If that says classic: conda install
    -n base conda-libmamba-solver, then conda config --set solver libmamba.
    Two things that also shrink the search space: pin the spec
    (numpy=1.15.4, not numpy) and use one channel, conda-forge or defaults,
    not both.

    The 'everything is up-to-date' line usually isn't lying about the
    channel it is looking at. conda update X only considers that env's
    configured channels, and it won't move X if that would break something
    else pinned in the env. conda search -c conda-forge X tells you whether
    a newer build exists for the platform at all. That is the check I would
    run before believing it.

    On your OS-package-manager suggestion: Martin's pushback is right, and
    I'd go further. Mixing distro Python packages with a conda env is a
    classic way to get the inconsistent env that stalls in the first place.
    Same language, two different installers, no shared record.

    I can't post to the list (my outbound to it is blocked), so passing it
    to you in case it's useful for the thread. No ask.

    - Honesty ------------------------------------------------------------------------


    Best wishes, and happy Python!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via XS News https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Tue Sep 22 07:44:30 2026
    On 21 Sep 2026 09:17:29 GMT, Martin Sch””n wrote:

    I am a full time Linux user and moved from pip to conda for managing
    my Python life a few years ago. I am not an advanced conda user by
    any measure. For the most part moving to conda was a good idea.

    My impression of Conda is that it?s more suited to Windows/Mac
    environments which lack native package management. For example, I
    don?t see a package for Conda under Debian -- surely something as
    useful as that is made out to be, would be supported. But it?s not.

    The most complex piece of third-party Python-based code that I install
    is Jupyter, and that goes quite nicely into a virtualenv maintained
    with pip.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Loris Bennett@3:633/10 to All on Tue Sep 22 10:14:14 2026
    Lawrence D?Oliveiro <ldo@nz.invalid> writes:

    On 21 Sep 2026 09:17:29 GMT, Martin Sch””n wrote:

    I am a full time Linux user and moved from pip to conda for managing
    my Python life a few years ago. I am not an advanced conda user by
    any measure. For the most part moving to conda was a good idea.

    My impression of Conda is that it?s more suited to Windows/Mac
    environments which lack native package management. For example, I
    don?t see a package for Conda under Debian -- surely something as
    useful as that is made out to be, would be supported. But it?s not.

    The most complex piece of third-party Python-based code that I install
    is Jupyter, and that goes quite nicely into a virtualenv maintained
    with pip.

    I help run a Linux HPC system at a university and see Conda being used by research mainly from the life sciences. I think the main advantage is that Conda also provides non-Python dependencies, such as CUDA for GPU-processing
    or numerical libraries written in C, such as BLAS. If, as Martin mentions,
    you are using Windows or MacOS, this is probably quite helpful.

    However, if you are on a Linux machine, the OS packages plus pip within a venv will, in my experience, get you quite a long way. That, together with poetry, has been all I have needed for developing my own software with Python, but obviously YMMV,

    Cheers,

    Loris

    --
    This signature is currently under constuction.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jon Ribbens@3:633/10 to All on Tue Sep 22 09:08:18 2026
    On 2026-09-22, Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
    On 9/22/2026 6:05 AM, Jon Ribbens wrote:
    On 2026-09-21, Martin Sch””n <martin.schoon@gmail.com> wrote:
    Den 2026-09-21 skrev Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>:
    On 9/21/2026 5:17 PM, Martin Sch””n wrote:
    <snip>

    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment >>>>> stalls at the 'solving environment' stage. I found a bunch of rather >>>>> different 'fixes'. I have not tried any yet. I think maybe I am doing >>>>> environments wrong.

    <snip>
    My thinking now:

    I should have more rather than fewer environments and make them more >>>>> task specific -- avoid 'general purpose' environments to limit the
    number of packages in each environment.

    I have noticed that "conda update whatever" /always/ tells me everything >>>>> is up-to-date. This can't be true. Will the procedure of the third
    bullet above solve this?

    No, I have not tried asking any LLM. I hope for some real human advice. >>>>>
    Dear Martin,
    <snip>
    Have you considered installing the offending package using your opera- >>>> ting system package manager instead, if available as such? There are
    n+1 [1] Linux package managers, so I leave off any suggestions for the >>>> command line tool.

    I think this is how most or even all Linux users start with Python. Then, >>> after a while you want to use a Python package (or version) not catered
    for by your system package manager...

    Indeed. Using the operating system package manager for Python
    packages is only feasible if you yourself are creating a package
    for that operating system.

    Point taken. Now, what is worrying me, is the lack of answers about the Conda package manager. I was under the impression Usenet was full of
    Python coders [1], and someone would know what to do about the original problem.

    Is there really, in all of Usenet, nobody who knows how to solve this?

    I've been using Python for nearly 30 years, but I'm afraid I've never
    heard of this 'conda' thing of which you speak. I use 'pip' for nearly everything, but apparently 'uv' is the new hotness.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Tue Sep 22 22:53:26 2026
    On 9/22/2026 5:08 PM, Jon Ribbens wrote:
    On 2026-09-22, Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
    On 9/22/2026 6:05 AM, Jon Ribbens wrote:
    On 2026-09-21, Martin Sch””n <martin.schoon@gmail.com> wrote:
    Den 2026-09-21 skrev Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>:
    On 9/21/2026 5:17 PM, Martin Sch””n wrote:
    <snip>

    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment >>>>>> stalls at the 'solving environment' stage. I found a bunch of rather >>>>>> different 'fixes'. I have not tried any yet. I think maybe I am doing >>>>>> environments wrong.

    <snip>
    My thinking now:

    I should have more rather than fewer environments and make them more >>>>>> task specific -- avoid 'general purpose' environments to limit the >>>>>> number of packages in each environment.

    I have noticed that "conda update whatever" /always/ tells me everything >>>>>> is up-to-date. This can't be true. Will the procedure of the third >>>>>> bullet above solve this?

    No, I have not tried asking any LLM. I hope for some real human advice. >>>>>>
    Dear Martin,
    <snip>
    Have you considered installing the offending package using your opera- >>>>> ting system package manager instead, if available as such? There are >>>>> n+1 [1] Linux package managers, so I leave off any suggestions for the >>>>> command line tool.

    I think this is how most or even all Linux users start with Python. Then, >>>> after a while you want to use a Python package (or version) not catered >>>> for by your system package manager...

    Indeed. Using the operating system package manager for Python
    packages is only feasible if you yourself are creating a package
    for that operating system.

    Point taken. Now, what is worrying me, is the lack of answers about the
    Conda package manager. I was under the impression Usenet was full of
    Python coders [1], and someone would know what to do about the original
    problem.

    Is there really, in all of Usenet, nobody who knows how to solve this?

    I've been using Python for nearly 30 years, but I'm afraid I've never
    heard of this 'conda' thing of which you speak. I use 'pip' for nearly everything, but apparently 'uv' is the new hotness.

    I've used Python sporadically since roughly 2011. I used to have nice
    O'Reilly books but have chosen not to try to reacquire those. They're
    probably obsolete.

    In any case, I've never used Conda either, and have managed so far with
    only a few pip installs.


    Best wishes, and happy Python!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via XS News https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Martin Schöön@3:633/10 to All on Tue Sep 22 19:53:20 2026
    Den 2026-09-21 skrev Martin Sch””n <martin.schoon@gmail.com>:
    <snip>
    Yesterday, however, I encountered a problem that a quick internet
    search told me is somewhat common: adding a package to an environment
    stalls at the 'solving environment' stage. I found a bunch of rather different 'fixes'. I have not tried any yet. I think maybe I am doing environments wrong.

    Among the 'fixes' suggested are:

    * Use mamba for installing packages.
    * conda config --set channel_priority strict
    * Remove and re-create environments to ensure packages are up-to-date.

    <snip>
    My thinking now:

    I should have more rather than fewer environments and make them more
    task specific -- avoid 'general purpose' environments to limit the
    number of packages in each environment.

    OK guys and gals, I have done some research and think I have answers.
    Yes, I have indeed done environments wrong!

    The following three are the most concise ones when it comes to advice: https://nsc.gitlab-pages.liu.se/berzelius-training/managing-conda-environments-best-practices/1.%20concepts/
    https://nsc.gitlab-pages.liu.se/berzelius-training/managing-conda-environments-best-practices/2.%20best-practices/
    https://msi.umn.edu/getting-started/help/knowledge-base/best-practices-conda

    These are also good: https://techietory.com/managing-python-environments-with-conda/ https://www.whiteboxml.com/blog/the-definitive-guide-to-python-virtual-environments-with-conda
    https://thejacksonlaboratory.github.io/bestpractices_workshop/conda.html

    TLDR:
    * Create task specific environments.
    * Use mamba.
    * Try, as far as possible, to instal all needed packages in one go.
    * Don't mend/tinker with environments. Create new ones instead.
    * Document your environments. README.md or something...

    I also asked Duck.ai (front end for Mistral Small 4 in my case) for
    advise. The results looks like a summary of the information I
    linked to. I will post it separately after having read through
    and figured out how to format it for usenet news.

    /Martin

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Wed Sep 23 04:57:20 2026
    On 9/23/2026 3:53 AM, Martin Sch””n wrote:

    TLDR:
    * Create task specific environments.
    * Use mamba.
    * Try, as far as possible, to instal all needed packages in one go.
    * Don't mend/tinker with environments. Create new ones instead.
    * Document your environments. README.md or something...

    I also asked Duck.ai (front end for Mistral Small 4 in my case) for
    advise. The results looks like a summary of the information I
    linked to. I will post it separately after having read through
    and figured out how to format it for usenet news.

    /Martin

    If you're wondering how to format text for Usenet, I like Emacs for this
    task. I then paste into Thunderbird for posting, but that's because I'm
    not inclined yet to figure out how to configure GNUS.

    I've also experimented with the WordPerfect [1] plain text output, but
    have not /mastered/ it for Usenet purposes.


    Happy formatting text for Usenet!


    [1] 6.2 for DOS, but any version should do.
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via XS News https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)