First, let's look at the definition of a project. A project is a folder that contains an anaconda-project.yml configuration file together with scripts (code), notebooks, datasets, and other files. We can add a folder into a project by adding a configuration file named anaconda-project.yml to the folder. The configuration file can include the following sections: commands, variables, services, downloads, packages, channels, and environment specifications. Data scientists can use projects to encapsulate data science projects and make them easily portable. A project is usually compressed into a .tar.bz2 file for sharing and storing.
Anaconda Project automates setup steps, so that people with whom you share projects can run your projects with the following single command:
anaconda-project run
To install Anaconda Project, type the following:
conda install anaconda-project
Anaconda Project encapsulates data science projects and makes them easily portable. It automates setup steps such as installing the right packages, downloading files, setting environment variables, and running commands. Project makes it easy to reproduce your work, share projects with others, and run them on different platforms. It also simplifies deployment to servers. Anaconda projects run the same way on your machine, on another user's machine, or when deployed to a server.
Traditional build scripts such as setup.py automate building of the project – going from source code to something runnable – while Project automates running the project, taking build artifacts, and doing any necessary setup before executing them.
We can use Project on Windows, macOS, and Linux. Project is supported and offered by Anaconda Inc® and contributors under a three-clause BSD license. Project sharing will save us a great deal of time, since other developers will not spend too much time on the work done already. Here is the procedure:
- Build up your project
- Log in to Anaconda
- From the project's directory on your computer, type the following command:
anaconda-project upload
Alternatively, from Anaconda Navigator, in the Projects tab, upload via the bottom-right Upload to Anaconda Cloud.
Projects can be any directory of code and assets. Often, projects will contain notebooks or Bokeh applications, for example. Here, we show how to generate a project called project01. First, we want to move to the correct location. Assume that we choose c:/temp/. The key command is given here:
anaconda-project init --directory project01
Next, both commands are shown side by side as well:
$ cd c:/temp/ $ anaconda-project init --directory project01 Create directory 'c:tempproject01'? y Project configuration is in c:tempproject01iris/anaconda-project.yml
The corresponding output is shown here:
![](assets/0d31d7d9-9772-47e8-a686-1c5f16268d3e.png)
We can also turn any existing directory into a project by switching to the directory and then running anaconda-project init without options or arguments. We can use MS Word to open anaconda-project.yml (see the first couple of lines shown here):
# 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: project01 # # Set the 'icon' key to give your project an icon # icon: # # Set a one-sentence-or-so 'description' key with project details # description: # # In the commands section, list your runnable scripts, notebooks, and other code. # Use `anaconda-project add-command` to add commands. #
There are two ways to share our projects with others. First, we archive the project by issuing the following command:
anaconda-project archive project01.zip
Then, we email the ZIP file to our colleague or others. The second way of sharing a project is to use Anaconda Cloud. Log in to Anaconda Cloud first. From the project's directory on our computer, type anaconda-project upload, or, from Anaconda Navigator, in the Projects tab, upload via the bottom-right Upload to Anaconda Cloud.