"SpecNotFound: Invalid name, try the format: user/package" in Creating new Conda env with yml file (Windows 10)

Question:

I’m trying to Create New conda environment by ‘Anaconda Prompt’ usnig yml File in Windows 10.
So here is the steps i made through:

1. using cd command i changed the directory to dir which my yml file located. (suppose my yml file is in c:/Users/<USER NAME>/.jupyter )
2. Then i used conda env create -f Python 310.yml command to create new conda env.

and what i got is:

SpecNotFound: Invalid name, try the format: user/package

Now I don’t know how can I solve this problem and exactly what is the meaning of this error.


Appendix

my Python 310.yml file contains these stuff:

enter image description here

Asked By: Shayan

||

Answers:

issue solved by changing contents of Python 310.yml and renaming yml file to Python310.yml. Here is the final .yml file content:

name: Python3.9 
channels:
  - defaults
dependencies:
  - numpy
  - pandas
  - matplotlib
  - pip
  - python=3.9.*      
  - python-dateutil
  - pytz
  - scikit-learn
  - scipy
  - statsmodels
  - xlrd
  - openpyxl
  - lxml
  - html5lib
  - beautifulsoup4
  - jupyter
  - pip:
    - pmdarima        
    - tensorflow
    - keras
prefix: C:UsersShayanAnaconda3envsPython3.9
Answered By: Shayan

You can use conda create -f Python 310.yml.

Answered By: Fauzan Azhar

drop the "env" in "conda env create" it’s just "conda create …"

Answered By: Chris

In my case the problem was that the file did not exist. So make sure that the file exists before running the update command.

Answered By: Helge Schneider

Make sure your directory is in "quotes", bc I got this error having whitespace inside it…

Answered By: N. Jonas Figge

The other answer says to:

drop the "env" in "conda env create" it’s just "conda create …"

This did not fix it for me by itself, but it did work after trying that and then after that trying the whole

conda env create -n myenv-dev --file my_env.yml

command again.

Answered By: stm

My solution was because I was running the following command on windows

conda env create -n spa --file .environment.yml

and in order to get it to run on my Ubuntu WSL2 just needed a minor update:

conda env create -n spa --file environment.yml
Answered By: ColtonNeary

I put the name of the yml file in double quotes and used the -f= notation and powershell no longer gave me an error. For you, that might mean:

conda env create -f="Python 310.yml"
Answered By: waiguoren
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.