Skip to content

NCSGgroup/PyTSCL-TWS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Project Setup Guide

This document explains how to create a Conda environment for this project, install Python 3.9.13, confirm the installation of additional packages during environment creation, activate the environment, and install the remaining dependencies from requirements.txt.

Prerequisites

Before getting started, make sure you have one of the following installed on your system:

You can verify that Conda is available by running:

conda --version

Step 1: Create a Conda Environment

Create a new Conda environment with Python 3.9.13. In the example below, the environment name is myenv:

conda create -n myenv python=3.9.13

During the creation process, Conda may display a message similar to:

Proceed ([y]/n)?

Type:

y

and press Enter to allow Conda to download and install the required additional packages.

Step 2: Activate the Environment

After the environment has been created successfully, activate it with:

conda activate myenv

Once activated, your terminal prompt should show the environment name, indicating that you are now working inside the new Conda environment.

Step 3: Install Project Dependencies

With the environment activated, navigate to the project root directory if you are not already there, and install the required Python packages listed in requirements.txt:

pip install -r requirements.txt

This command will install the additional project-specific dependencies.

Full Example

The complete setup process is shown below:

conda create -n myenv python=3.9.13
# type "y" when prompted to proceed

conda activate myenv
pip install -r requirements.txt

Verify the Python Version

To confirm that the environment is using the correct Python version, run:

python --version

You should see:

Python 3.9.13

Optional: Check Installed Packages

To view the packages installed in the current environment, use:

pip list

or:

conda list

Optional: Deactivate the Environment

When you are done working in the environment, you can deactivate it by running:

conda deactivate

Optional: Remove the Environment

If you want to delete the environment completely, use:

conda remove -n myenv --all

Notes

  • You may replace myenv with any environment name you prefer.
  • Make sure that requirements.txt is located in the project root directory before running the installation command.
  • It is recommended to activate the Conda environment before installing any dependencies.
  • If pip install -r requirements.txt fails for certain packages, check whether system-level dependencies are required.

Troubleshooting

Conda command not found

If your terminal says conda: command not found, Conda may not be installed correctly or may not be added to your system PATH. Please install Anaconda or Miniconda and restart your terminal.

Environment activation does not work

If conda activate myenv does not work, try initializing Conda first:

conda init

Then restart your terminal and run the activation command again.

requirements.txt not found

If you see an error indicating that requirements.txt cannot be found, make sure you are in the correct project directory:

ls

or on Windows:

dir

You should see requirements.txt listed in the current folder.

Testing

After installing the dependencies, you can run a few simple checks to verify that the environment and the project are set up correctly.

Example 1: Check whether key packages are available

Run the following command:

python -c "import numpy, pandas; print('Environment is ready.')"

If everything is installed correctly, you should see:

Environment is ready.

Example 2: Run the project

If your project has an entry script, you can test it with:

python main.py

Please replace main.py with the actual entry file of your project if needed.

This will help confirm that the code is functioning as expected after installation.

Summary

In short, the setup process is:

  1. Create the environment with Python 3.9.13
  2. Type y to confirm package installation
  3. Activate the environment
  4. Install dependencies from requirements.txt
conda create -n myenv python=3.9.13
conda activate myenv
pip install -r requirements.txt

About

A Python implementation of Two-Stage Covariance Learning (TSCL) for efficient emulation of GRACE(-FO) terrestrial water storage noise covariance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages