相关文章推荐
睿智的小蝌蚪  ·  c# - dotnet test ...·  1 年前    · 
健身的鸡蛋面  ·  docker-compose 部署 ...·  1 年前    · 
爱旅游的保温杯  ·  System Requirements, ...·  1 年前    · 
狂野的啄木鸟  ·  Understanding and ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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?

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

I'd like to mention that this "warning" is actually not a warning, since it will be printed indefinitely without another action, but an error. But as described, just adding the pip before solves the issue. Thank you :) – themenace Oct 2, 2021 at 8:29

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 your 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

Thank you very much! I add pip in the environment.yml file under the dependencies then it works. – QMarkLi Oct 25, 2019 at 8:12 Which version of pip should I install? There are so many errors in the next step after I add pip==19.3.1 in dependencies. – QMarkLi Oct 27, 2019 at 8:38 What are the errors? 19.3.1 should be fine if you are working with latest packages. But if you are using some deprecated packages you should be using older versions of pip. You can post a new question with your yml file and errors – ArunJose Oct 28, 2019 at 2:37 The error shows the version of "cloudpickle" is wrong. I will post a new question, thank you! – QMarkLi Oct 29, 2019 at 1:38

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.