Isuru Dharmadasa
Isuru Dharmadasa

Reputation: 458

How do I set optional arguments in the conda environment.yml file?

I am currently working with GeoPython - Auto GIS. After research on the work flow with conda+python, I have found out how to create and specify the packages in an environment.yml file. But I found no way to specify an optional arguement. An example is as follows,

The equivalent of this conda command

conda install -y -c conda-forge geopandas

is the following in environment.yml

name: parkar
channels:
- conda-forge
- defaults
dependencies:
- geopandas

(See how conda environment files are made at section Conda Environment Files of this link)

But I could not find a way to specify the following command [a],

conda install -y -c conda-forge basemap=1.0.8.dev0 --no-deps

I did try it like this,

- basemap=1.0.8.dev0 --no-deps

But ended up with the following promt when I ran conda env update --file environment.yml

CondaValueError: invalid package specification: basemap=1.0.8.dev0 --no-deps

I also tried exporting the environment.yml file of the 'base' conda environment after running the above command [a] and got the following line where basemap=1.0.8.dev0 dependency was at,

  - basemap=1.0.8.dev0=np111py35_1

Any one ever encountered this problem or has a solution?

Upvotes: 10

Views: 2563

Answers (1)

Isuru Dharmadasa
Isuru Dharmadasa

Reputation: 458

Specifying the optional argument as follows resulted in avoiding the above error

- basemap=1.0.8.dev0 [--no-deps]

Upvotes: 7

Related Questions