On Tue, Jul 05 2022, Jim McNamara wrote:
> I am trying to test an earlier version 3.9.4 of python to see if it works
> better, but offlineimap doesn't seem to get it that I am in that
> environment even after I activate it.
Ah, the beauty of Python. One would think that after the debacle that was the
2.7 to 3.x transition the devs would know better. But apparently they haven't
had enough and are aiming for even greater confusion by not even changing the
major version...
It seems that every time I try to use Python 3.10, something turns out to be
incompatible and I need to revert to 3.9. Luckily I'm using a distro that's
conservative enough to keep 3.9 the system Python.
Anyway, to turn to your problem: I don't think you can use an Anaconda
environment to run a system Python script, at least not without some additional
work. A virtualenv is basically just a separate shell process with a properly
manipulated PATH variable. In order for offlineimap to use the virtualenv, you'd
have to make sure it's started inside the env. A globally installed offlineimap
normally won't.
The simplest solution would really be to downgrade your system Python to 3.9,
but I don't how easy that is in your case. It will depend on the distro you're
using.
Alternatively, you may try using [pyenv](
https://github.com/pyenv/pyenv) (note:
not "pyvenv"!) to install Python 3.9 next to 3.10 and make it the default
version for your system. I'm not sure if that will work, though, I've never had
the occasion to try.
Another approach would be to look at the way offlineimap is run. You could, of
course, start it manually from a bash shell after activating the virtualenv you
created for it (and keep it running in daemon mode). It should also be possible
to create a wrapper script for offlineimap that first activates the virtualenv
and then runs offlineimap inside it.
Very general advice, I know... Perhaps it can put you in the right direction.
Joost
--
Joost Kremers
Life has its moments