Skip to content

Commit b1a0f74

Browse files
update install instructions to use uv
1 parent b3badc9 commit b1a0f74

File tree

1 file changed

+37
-56
lines changed

1 file changed

+37
-56
lines changed

docs/GettingStarted/InstallSDK.md

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,92 +2,73 @@
22

33
The [Naptha SDK](https://github.com/NapthaAI/naptha-sdk) is a Python library that allows you to interact with the Naptha ecosystem, such as the Naptha Hub and Naptha Nodes (for deploying agents and other modules, and acessing inference and storage). It can be used in Naptha Modules, and other components with other agent frameworks like CrewAI.
44

5-
You can install the SDK using PyPI or from source.
5+
## 🧩 Installing the SDK
66

7-
## Install using PyPI
7+
You can install the SDK using PyPI or from source. We recommend using `uv` as a package manager. Follow the installation instructions [here](https://docs.astral.sh/uv/getting-started/installation/) to install `uv`.
88

9-
```bash
10-
pip install naptha-sdk
11-
```
9+
### Install within an existing project
1210

13-
## Create a User Account for using the Naptha Hub and Naptha Nodes
14-
15-
You can create an account on the Naptha Hub (and generate your ```PRIVATE_KEY```) using the Naptha CLI:
11+
If you want to install the naptha-sdk as part of an existing project (e.g. [to deploy existing agents from third-party frameworks on the Web of Agents](https://docs.naptha.ai/Integrations/Decorators)), it is good practice to do so within a dedicated virtual environment. If you don't already have a virtual environment, create a new one using `uv`:
1612

1713
```bash
18-
naptha signup
14+
uv init --python ">=3.10,<3.13"
1915
```
20-
:::info
21-
This command will prompt you to create an account by entering a username and password. It also automatically generates a private key and stores it in your .env file.
22-
:::
23-
24-
## Configure Environmental Variables
2516

26-
### Configure ```NODE_URL```
27-
Choose whether you want to interact with a *local* or *hosted* Naptha node.
28-
29-
#### Local Node
30-
For a local node, set ```NODE_URL=http://localhost:7001``` in the .env file.
31-
32-
#### Hosted Node
33-
To use a hosted node, set e.g. ```NODE_URL=https://node.naptha.ai``` or ```NODE_URL=https://node2.naptha.ai``` in the .env file.
34-
35-
36-
## Install from Source
37-
38-
To install from source, follow these steps:
39-
40-
1. Install Poetry with pipx
41-
2. Install Naptha SDK
42-
3. Setup dev environment
43-
44-
### 1. Install Poetry with pipx
45-
46-
Naptha uses a Python dependency management tool called Poetry. Learn more about Poetry in their official [docs](https://python-poetry.org/docs). Run this command:
17+
Then install the SDK:
4718

4819
```bash
49-
pipx install poetry
20+
uv add naptha-sdk
21+
source .venv/bin/activate
5022
```
5123

52-
> Poetry should always be installed in a dedicated virtual environment to isolate it from the rest of your system.
53-
54-
### 2. Clone Naptha SDK
55-
56-
Clone the Repository and navigate to the SDK directory:
24+
Alternatively, if you have an existing project that doesn't use `uv` you can also install using:
5725

5826
```bash
59-
git clone https://github.com/NapthaAI/naptha-sdk.git && cd naptha-sdk
27+
pip install naptha-sdk
6028
```
6129

62-
Install the dependencies using Poetry:
30+
### Install from source
6331

64-
```bash
65-
poetry install
66-
```
67-
68-
Activate the virtual environment:
32+
If you are a developer contributing to the Naptha SDK, you will want to install from source using:
6933

7034
```bash
35+
git clone https://github.com/NapthaAI/naptha-sdk.git
36+
cd naptha-sdk
37+
uv venv
7138
source .venv/bin/activate
39+
uv pip install .
7240
```
7341

74-
Next, create a copy of the .env file:
42+
## 🔥 Create a User Account for using the Naptha Hub and Naptha Nodes
7543

76-
```bash
77-
cp .env.example .env
78-
```
44+
Your Naptha account is your identity on the Naptha platform. It allows you to:
7945

80-
#### Configure Variables
46+
- Deploy and run agents, tools, environments and other modules on Naptha Nodes (via a public/private keypair)
47+
- Access and interact with the Naptha Hub's features and services (via a username and password)
8148

82-
Choose whether you want to interact with a local Naptha node or a hosted Naptha node. For a local node, set ```NODE_URL=http://localhost:7001``` in the .env file. To use a hosted node, set ```NODE_URL=https://node.naptha.ai``` or ```NODE_URL=https://node1.naptha.ai```.
49+
The simplest way to create a new account is through the interactive CLI. Run the following command:
8350

51+
```bash
52+
naptha signup
53+
```
54+
55+
:::info
56+
This command will prompt you to create an account by entering a username and password. It also automatically generates a private key and stores it in your .env file.
57+
:::
8458

85-
To check the installation, run:
59+
Or if you have already have set up an identity, edit your `.env` file with your desired credentials:
8660

8761
```bash
88-
naptha
62+
# .env file
63+
HUB_USERNAME=your_username
64+
HUB_PASSWORD=your_password
65+
PRIVATE_KEY=your_private_key # Optional - will be generated if not provided
8966
```
9067

68+
## ⚙️ Configure Environmental Variables
69+
70+
Choose whether you want to interact with a *local* or *hosted* Naptha node. For a local node, set ```NODE_URL=http://localhost:7001``` in the .env file. To use a hosted node, set e.g. ```NODE_URL=https://node.naptha.ai``` or ```NODE_URL=https://node2.naptha.ai``` in the .env file.
71+
9172
## Need Help?
9273

9374
- Join our [Community](https://naptha.ai/naptha-community) and post in the #support channel

0 commit comments

Comments
 (0)