0

I am trying to create a new empty evironment with conda using the command:

conda create -n name python=3.6

Then I activate the environment and export it with

 conda env export > environment.yml

I have noticed that the generated yml files contains a lot of pip packages that I guess are installed system wide. I am a ROS user and all the python packages installed by ROS appear there. Is there a way to ensure that those pip packages are not included in my new environment?

Thanks a lot for your help.

  • 2
    have you activated the new environment you created? https://stackoverflow.com/questions/20081338/how-to-activate-an-anaconda-environment – Kannappan Sirchabesan Jan 22 '19 at 14:52
  • Edited to answer your comments. Yes the environment was activated. Please note that I have also tried the command conda env export -name myenv > environment.yml but got the same thing. – Baptiste BUSCH Jan 23 '19 at 16:13

1 Answers1

1

Make sure that you created the environment not using

conda env create -n name python=3.6

but using instead the command

conda create -n name python=3.6

Using the first command will link all packages from your base environment.

Also note that your new environment will contain several default packages (such as Python 3.6, pip, etc.) if you use the flag python=3.6 when creating the environment.

Martin
  • 170
  • 2
  • 11
  • I must have been confused and used `conda env create -n name python=3.6` indeed although it returns `SpecNotFound: Invalid name, try the format: user/package` when I try it. Anyway my initial problem does not appear anymore so I guess the command I was using was probably linking all packages in my new environment as you describe. `conda create -n name python=3.6` works as intended. Thanks for your reply. – Baptiste BUSCH Apr 01 '19 at 08:11