To ensure a smooth onboarding experience with femtoAI tools and SDKs, developers should be familiar with the basics of Python environments and package management. This guide provides a brief overview of the concepts and tools required.
1. Common CLI Commands
Distributors should be comfortable navigating the terminal or command line interface (CLI), as many SDK tools are CLI-based.
Basics
- Navigate directories:
cd /path/to/directory
- List files:
ls # Unix/macOS
dir # Windows
- Check current directory:
pwd # Unix/macOS
- Make a new directory:
mkdir new-folder
- Run a Python script:
python script.py
Helpful Tips
- Use the
--helpflag to see options for most commands:
python script.py --help
π Learn more: Linux Command Line Basics (by freeCodeCamp)
2. Python Environments
Python environments help isolate project dependencies to avoid conflicts between different tools and libraries. At femtoAI, we recommend using conda for environment management.
Using Conda
- Create a new environment:
conda create -n femto-env python=3.10
- Activate the environment:
conda activate femto-env
- Install packages inside the environment:
pip install -r requirements.txt
- Deactivate when done:
conda deactivate
Best Practices
- Create a new conda environment for each project or version of the SDK.
- Always activate your environment before running scripts or installing packages.
π Learn more: Conda User Guide
2b. Understanding Folder Structure for Conda Environments
When using Conda (or Anaconda), environments and packages are typically stored in predefined directories. Understanding where these are located can help you keep your setup organized.
Default Folder Locations
- Anaconda Installation Folder: This is where the base Anaconda system is installed. Example:
- Windows:
C:/Users/YourName/Anaconda3 - macOS/Linux:
/Users/YourName/anaconda3or/home/username/anaconda3
- Windows:
- Environments Folder:
- By default, new environments are stored inside
envs/within the Anaconda folder:- Example:
C:/Users/YourName/Anaconda3/envs/femto-env
- Example:
- By default, new environments are stored inside
- Your Project Folder: This is where your actual project files (scripts, SDK, model files, etc.) live. This can be anywhere you choose, like:
C:/Users/YourName/Documents/femtoAI_project/home/username/projects/femtoAI_project
Folder Tree Example
C:/Users/YourName/
βββ Anaconda3/
β βββ envs/
β β βββ femto-env/
β βββ pkgs/
βββ Documents/
β βββ femtoAI_project/
β βββ script.py
β βββ requirements.txt
Tips
- You do not need to move your project files into the Anaconda folder.
- Just activate the correct Conda environment in your terminal before working in your project folder:
conda activate femto-env
cd ~/Documents/femtoAI_project
π Learn more: Managing Environments in Conda
3. Python Package Management
Python uses package managers to install and manage libraries or tools (known as packages). At femtoAI, you’ll be working with Python packages for interacting with our SDK, tooling, and possibly for running inference workflows.
Key Concepts
- pip: The standard Python package installer. Example:
pip install femtocrux
- requirements.txt: A file listing required packages and versions.
To install all dependencies for a project,cdinto the project directory with arequirements.txtthen run the following command:
pip install -r requirements.txt
- PyPI: The Python Package Index, the default source for pip packages.
- Editable installs: Used for development. If working with a cloned repo:
pip install -e .
Tips
- Always ensure pip is up to date:
pip install --upgrade pip
- Use version pinning (
==) in requirements to ensure compatibility.
π Learn more: pip Documentation
Summary
Before using femtoAI tools:
- Be comfortable setting up and using conda environments.
- Know how to install Python packages with pip.
- Be fluent in common command line tasks to navigate and execute scripts.
This foundation ensures that developers can successfully run examples, use the SDK, and integrate femtoAI capabilities into their workflows.
For detailed installation steps, refer to the femtoAI SDK documentation.
Need help? Contact your femtoAI technical point of contact or tech-support@femto.ai