After I run the conda env create -f environment.yml
in Conda, I receive the following warning:
Warning : you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies...
What does this mean and what should I be doing instead?
yml file. Note that by convention Conda environment files are called environment. yml . As such if you use the conda env create sub-command without passing the --file option, then conda will expect to find a file called environment.
A . yml file is a text file that contains a list of dependencies and which channels you prioritize downloading them on. You can use the earth-analytics-python yaml file called environment.
To activate your Conda environment, type source activate <yourenvironmentname> . Note that conda activate will not work on Discovery with this version. To install a specific package, type conda install -n <yourenvironmentname> [package] . To deactivate the current, active Conda environment, type conda deactivate .
When creating an environment the warning disappeared by including - pip
explicitly in the yaml file. Yes, it is a bit awkward because if your environment has pip packages you already have declared that you used pip packages with - pip:
The yaml file would look like:
# Packages omitted for simplicity
name: myenv
channels:
- anaconda
- conda-forge
- defaults
dependencies:
- python
- scipy
- pip
- pip:
- datetime
At the time of creating a new environment from scratch this warming can be avoided by explicitly installing pip, for instance with: conda create -n env_with_pip python=3.7 numpy pip
In your environment yml file under list of the packages you install through conda you must also add pip as a package to be installed. This installs the pip, and so you pip packages can be installed using this pip.
Previously pip was shipped with conda but now we have to explicitly install pip when using conda
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