I have an environment.yml file, but don't want to use Conda:
name: foo
channels:
- defaults
dependencies:
- matplotlib=2.2.2
Is it possible to have pip install the dependencies inside an environment.yml file as if it's a requirements.txt file?
I tried pip install -r environment.yml and it doesn't work with pip==22.1.2.
Based on Beni implementation, I just wanted to adjust the code since it has lots of errors;
import os
import yaml
with open("environment.yaml") as file_handle:
environment_data = yaml.safe_load(file_handle)
for dependency in environment_data["dependencies"]:
if isinstance(dependency, dict):
for lib in dependency['pip']:
os.system(f"pip install {lib}")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With