Git Product home page Git Product logo

Comments (7)

goanpeca avatar goanpeca commented on May 29, 2024

@AlbertDeFusco I think that if you have an environment.yml file inside a directory/folder and then do anaconda-project init (or the right command, can't remember now) should search for that and use it.

Is not this the case @havocp ?

from anaconda-project.

havocp avatar havocp commented on May 29, 2024

Yes, if you put environment.yml in a folder and anaconda-project init that folder it should import it. You can also cut-and-paste into an anaconda-project.yml that you have (rename dependencies to packages I think is the only format difference).

from anaconda-project.

havocp avatar havocp commented on May 29, 2024

Are things working for you, can this issue be closed?

from anaconda-project.

AlbertDeFusco avatar AlbertDeFusco commented on May 29, 2024

Perhaps not. I created a new project in Navigator

# This is an Anaconda project file.
#
# Here you can describe your project and how to run it.
# Use `anaconda-project run` to run the project.
# The file is in YAML format, please see http://www.yaml.org/start.html for more.
#

#
# Set the 'name' key to name your project
#
name: new_proj
#
# Set the 'icon' key to give your project an icon
#
icon:
#
# In the commands section, list your runnable scripts, notebooks, and other code.
# Use `anaconda-project add-command` to add commands.
#
commands: {}
#
# In the variables section, list any environment variables your code depends on.
# Use `anaconda-project add-variable` to add variables.
#
variables: {}
#
# In the services section, list any services that should be
# available before your code runs.
# Use `anaconda-project add-service` to add services.
#
services: {}
#
# In the downloads section, list any URLs to download to local files
# before your code runs.
# Use `anaconda-project add-download` to add downloads.
#
downloads: {}
#
# In the packages section, list any packages that must be installed
# before your code runs.
# Use `anaconda-project add-packages` to add packages.
#
packages: []
#
# In the channels section, list any Conda channel URLs to be searched
# for packages.
#
# For example,
#
# channels:
#    - https://conda.anaconda.org/asmeurer
#
channels: []
#
# You can define multiple, named environment specs.
# Each inherits any global packages or channels,
# but can have its own unique ones also.
# Use `anaconda-project add-env-spec` to add environment specs.
#
env_specs: {default: {packages: [anaconda], channels: []}}

I then copy the environment.yml to the project directory.

>anaconda-project init
Environment spec 'my_env' from environment.yml is not in anaconda-project.yml.
Unable to load the project.

Is there something I have to do to register the environment name?

from anaconda-project.

havocp avatar havocp commented on May 29, 2024

Ah, the issue is that you already have a project here when you init. I opened #53 on that, it should say "project is already initialized" or something maybe.

If you do anaconda-project anything-except-init it may ask you whether you want to import that environment. However, you'll then have default and my_env env specs, and you'll have to delete the extra one.

What should also work is if you had not initialized already, i.e. you had environment.yml and NOT anaconda-project.yml, then anaconda-project init would use the environment.yml to create the default environment in the new anaconda-project.yml.

Maybe it's simpler to just have a command like anaconda-project import environment.yml, opened #54 to think about that.

from anaconda-project.

AlbertDeFusco avatar AlbertDeFusco commented on May 29, 2024

Thanks! That's what I needed. I removed the anaconda-project.yml and ran anaconda-project init. That correctly imported the env into the new project file as

env_specs: {my_env: {packages: [python=3, jupyter, nbformat, pandoc, bokeh, pygithub,
      {pip: [pypandoc]}], channels: [conda-forge]}}

from anaconda-project.

AlbertDeFusco avatar AlbertDeFusco commented on May 29, 2024

Still works

from anaconda-project.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.