Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you conda install a library in an environment created with virtualenv?

I'm working on a (python) project where the choice was to create a virtual environment using virtualenv. However, one of the project dependencies can't be installed through pip on macOS due to this bug: https://github.com/streamlit/streamlit/issues/283

The workaround is to conda install one of the dependencies to bypass the gcc compiler.

How do you conda install something in a virtual environment not created with conda?

like image 329
Myccha Avatar asked Dec 22 '22 20:12

Myccha


1 Answers

I think the easiest approach would be to create a conda env by it's own.

1) Create a requirement.txt file by doing pip freeze > requirements.txt inside your virtualenv environment

2) Create conda env: conda create --name myenv

3) Activate your environment: source activate myenv

4) Install your dependencies: conda install --file requirements.txt

5) Install missing dependecy: conda install YOUR_MISSING_DEPENDENCY

like image 126
Tim Avatar answered Dec 31 '22 12:12

Tim