Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda env processing to provide more helpful messages #5885

Closed
ijstokes opened this issue Aug 25, 2017 · 5 comments · Fixed by #7395
Closed

conda env processing to provide more helpful messages #5885

ijstokes opened this issue Aug 25, 2017 · 5 comments · Fixed by #7395
Assignees
Labels
locked [bot] locked due to inactivity plugins::env pertains to conda-env source::anaconda created by members of Anaconda, Inc. type::feature request for a new feature or capability
Milestone

Comments

@ijstokes
Copy link

ijstokes commented Aug 25, 2017

From the Anaconda ML (see last half of this thread ) :

I have my yml file at place the file looks like this:
ls ps-env shows the file

name: ps-env
dependecies:
  - python = 3.5.2
  - pandas = 0.17.1
  - numpy = 1.13.1
  - sklearn = 0.19.0
  - scipy = 0.19.1
  - tensorflow
  - keras
  - imbalanced-learn

I still get the error. It doesnt make sense to me

Can you spot the problem? I tried myself, putting that YAML into a file testml.yaml, and got:

$ conda env create --file testml.yaml 
Using Anaconda API: https://api.anaconda.org

SpecNotFound: Can't process without a name

Someone on the ML pointed out the issue: spelling mistake in the YAML. I'd suggest a few things:

  • improve the error message to say something like:

    "dependencies" section not found, unable to create conda environment
    
  • report any sections that are found that are unexpected and are going to be ignored (such as dependecies

  • use something like Kwalify (and perhaps pykwalify ) to test/assert an open schema on the JSON for env files

@d53dave
Copy link

d53dave commented Sep 21, 2017

I ran into the same issue today and wasted an hour googling. This should be improved.

@jbednar
Copy link

jbednar commented Oct 18, 2017

I ran into the same issue today when trying to debug a problem reported by one of my software's users, but had a hunch and tried using a completely made-up environment file name, with the same result as they reported:

$ conda env create --file dalsfkjdasljfkdsa 
Using Anaconda API: https://api.anaconda.org

SpecNotFound: Can't process without a name

Please, can this situation be detected and an appropriate error message given, like "Specified environment file not found"? This has to be a common occurrence, and the error message sends users in completely the wrong direction. Worse, the above examples indicate that users will get the same message for typos within the file, so people who find this issue on the web will have no idea whether it's a problem finding the file or a problem within the file.

@cdeil
Copy link
Contributor

cdeil commented Feb 14, 2018

I made the same mistake today:

$ conda env update -f environment.yml

SpecNotFound: Can't process without a name

but my env file was called environment-dev.yml.

I didn't realise what the problem was at first, so I tried -n to give a name on the command line (even though the name was already given in the env file), and got another error that didn't help me realise my mistake:

$ conda env update -f environment.yml -n gammapy-dev

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

As the others suggested, could please improve the error message to say "Environment file not found: environment.yml"?

@kalefranz kalefranz added tag:environment-spec type::feature request for a new feature or capability source::anaconda created by members of Anaconda, Inc. labels Feb 28, 2018
@Nkongnenwi
Copy link

if the error still persist and you had once created an environment with the name env in your anaconda directory then you should probably make use of the virtual environment to to install the new environment for example.
Step: 1 Assuming this is the directory
c:\users\name\downloads\activate tensorflow #replace the tensorflow with the name of your virtual environment
Step: 2 from within the environment run this
(tensorflow)c:\users\name\downloads\conda env update -f environment.yml #in some cases it is environments.yml with a difference in s at the end

I don't know if that solves the problem for you!!!

@goanpeca goanpeca self-assigned this Jun 5, 2018
goanpeca added a commit that referenced this issue Jun 14, 2018
Fix #5885 improve conda env error messages and add extra tests
@kalefranz kalefranz added this to the 4.6.0 milestone Jul 2, 2018
@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Sep 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2021
@kenodegard kenodegard added plugins::env pertains to conda-env and removed tag::environment-spec labels Jan 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity plugins::env pertains to conda-env source::anaconda created by members of Anaconda, Inc. type::feature request for a new feature or capability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants