:: Re: [DNG] help with python error (S…
Forside
Slet denne besked
Besvar denne besked
Skribent: Marc Shapiro
Dato:  
Til: dng
Emne: Re: [DNG] help with python error (SOLVED)

On 2/15/25 6:04 AM, Ludovic Bellière via Dng wrote:
> The point of using a virtual environment is so that dependencies don't
> override
> whatever exists on the system. It seems to me that you don't
> understand how it
> all works.
>
> When you install something in a venv, pip will pull dependencies of
> that thing,
> then dependencies of those dependencies. All that will only be
> accessible from
> within the venv.

I do understand the basics of how venvs work, and why.  It took a little
Googling to find a good explanation and HOWTO.  That was when I gave it
a try.
>
>> I even tried to install a package INSIDE an active venv and pip gave
>> me the
>> whole spiel about being in an externally managed environment!
>
> This tells me that you didn't activate the venv and pip recognized
> that the
> operation would install system-wide. So it stopped you doing something
> stupid.

Wrong.  I had activated the venv.  The prompt line before I tried the
pip install started with (venv), so did the one after the error message!
>
>>
>> It seems like virtual environments should be easy to set up and use,
>> but they will not work on this box!
>>
>
> They are. I use them nearly every day. To activate a venv, you need to
> source
> `venv/bin/activate`. It is a bash script that changes the environment
> variables
> to ensure that the libraries and software present in the virtual
> environment are
> prefered over the system's. It won't stop whatever tool you use to
> reach the
> system's libraries if none exists within the venv.
>
> The way you solved your issue is so convoluted, it boggle my minds it
> even
> worked at all. It's a sure way to have something bite your ass in a
> few months
> or years.

Nothing convoluted about it.
>
> Anyhow, if it works...


Here is what I THINK happened -- Chimaera and Daedalus have .deb
packages for appdirs.  My Excalibur installation was an upgrade from a
Daedalus installation, so appdirs was available.  I have done apt
upgrades a few times recently, and I think that appdirs got removed and
that is when my problems started.  I don't know what I may have done
wrong when I attempted to install the venv and appdirs within it, but
something went wrong.  I think it was then that the newer appdirs got
installed in ~/.local/ causing the other errors that popped up after
appdirs was found.  Removing the newer appdirs that was pre-empting the
one I originally had and restoring the older version eliminated all of
the errors and has me running properly again.

Marc