[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to let tramp be aware the virtualenv?

From: Yuri Khan
Subject: Re: How to let tramp be aware the virtualenv?
Date: Wed, 17 Jul 2019 23:02:10 +0700

On Wed, Jul 17, 2019 at 8:41 PM Zhongwei Yao <address@hidden> wrote:

> I want to make the compilation under tramp know which python virtual env is
> activate. Currently, I have a workaround by using the following compile
> command:
>   . /path/to/the/virtual/env/activate && python --version

In many cases, you do not need to activate the virtualenv
specifically. You can just execute whatever script you want using the
copy of the python executable installed in that environment’s bin

/path/to/the/virtual/env/bin/python --version

Disclaimer: I have only verified this to work in Python 3.5 and above,
and never tried that over Tramp.

Also, if your Python program calls an external subprocess that in turn
calls another Python program without specifying the interpreter path,
it will get executed with the default interpreter, which might not be
what you want.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]