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

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



Solution 1:[1]

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:\Users\Shayan\Anaconda3\envs\Python3.9

Solution 2:[2]

drop the "env" in "conda env create" it's just "conda create ..."

Solution 3:[3]

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

Solution 4:[4]

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

Solution 5:[5]

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

Solution 6:[6]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Chris
Solution 3 Fauzan Azhar
Solution 4 Helge Schneider
Solution 5 N. Jonas Figge
Solution 6 Gino Mempin