# \[Feature request\] Activating conda/virtualenv environments on xfunc

**URL:** <https://forum.compas-framework.org/t/feature-request-activating-conda-virtualenv-environments-on-xfunc/47>\
**Category:** compas\
**Created:** [February 9, 2018, 4:11pm UTC](https://forum.compas-framework.org/t/feature-request-activating-conda-virtualenv-environments-on-xfunc/47 "2018-02-09T16:11:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzalocasas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/gonzalocasas/32/127_2.png) [@gonzalocasas](https://forum.compas-framework.org/u/gonzalocasas)\
**Post date:** [February 9, 2018, 4:11pm UTC](https://forum.compas-framework.org/t/feature-request-activating-conda-virtualenv-environments-on-xfunc/47/1 "2018-02-09T16:11:10Z")

</div>

It would be important to be able to specify which environment needs to be activated when calling an XFunc.

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [February 9, 2018, 7:34pm UTC](https://forum.compas-framework.org/t/feature-request-activating-conda-virtualenv-environments-on-xfunc/47/2 "2018-02-09T19:34:13Z")

</div>

hi gonzalo,

which command do you currently use to activate a virtual environment? something like:

```auto
source path/to/my/venv/bin/activate

```

best,  
tom

---

<div class="post-metadata">

**Author:** ![gonzalocasas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/gonzalocasas/32/127_2.png) [@gonzalocasas](https://forum.compas-framework.org/u/gonzalocasas)\
**Post date:** [February 10, 2018, 7:49am UTC](https://forum.compas-framework.org/t/feature-request-activating-conda-virtualenv-environments-on-xfunc/47/3 "2018-02-10T07:49:23Z")

</div>

It depends on the virtual environment manager and on the OS.

Using conda is:

- Windows: `activate myenv`
- mac / linux: `source activate myenv`

(where `myenv` is env name, not path)

But using `virtualenv` is a tad different (`\path\to\env\Scripts\activate` and `source path/bin/activate` on Win and Mac/Linux respectively). And using `Pipenv` is again different.

In any case, maybe it makes sense to go for the same approach `gh-python-remote` uses, it already works with conda and without:

> <https://github.com/Digital-Structures/ghpythonremote/blob/master/ghpythonremote/helpers.py#L9>

 ![image](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/fa403ebb6f5f836eae6622ca1f5278ceb671fd71.png)
