@@ -12,18 +12,57 @@ CoCalc is a pretty large and complicated project, and it will only work with the
12
12
. /cocalc/nvm/nvm.sh
13
13
```
14
14
15
- - Make sure to[ install the newest version of pnpm as well;] ( https://pnpm.io/installation ) one way to do that is as follows:
15
+ Alternatively, if you are already using [ Node Version Manager] ( https://github.com/nvm-sh/nvm ) , you can simply run the
16
+ following command to use a version of Node guaranteed to work with this project:
17
+
18
+ ``` sh
19
+ ~ /cocalc/src$ nvm install && nvm use
20
+ ```
21
+
22
+ _ Note that ` nvm install ` is only required the first time you run this command or when CoCalc's Node version changes_ .
23
+
24
+ - Make sure to [ install the newest version of pnpm as well;] ( https://pnpm.io/installation ) one way to do that is as follows:
16
25
17
26
``` sh
18
27
npm install -g pnpm
19
28
```
20
29
21
- - Python: You must have python3 installed with the pyyaml package, so ` import yaml ` works. Do ` pip3 install pyyaml ` if not.
30
+ Alternatively, if you do not wish to install ` pnpm ` globally, you can run ` npm install ` to install it as a dev
31
+ dependency.
32
+
33
+ ** Python virtual environment**
34
+
35
+ Some features of CoCalc (e.g., file creation) require local Python modules to be installed. To create a [ Python virtual
36
+ environment] ( https://docs.python.org/3/library/venv.html ) from which to run these modules, run (from the ` src `
37
+ directory):
38
+
39
+ ``` sh
40
+ ~ /cocalc/src$ python3 -m venv venv
41
+ ```
42
+
43
+ To activate the virtual environment, run
44
+
45
+ ``` sh
46
+ ~ /cocalc/src$ source ./venv/bin/activate
47
+ ```
48
+
49
+ To install required dependencies, run
50
+
51
+ ``` sh
52
+ (venv) ~ /cocalc/src$ pip install -r requirements.txt
53
+ ```
54
+
55
+ ** You must have your virtual environment activated when running the CoCalc Hub (via ` pnpm hub ` )!** If, on the other
56
+ hand, you prefer that development packages be installed globally, you can jump directly to the above ` pip install `
57
+ command outside the context of a virtual environment.
22
58
23
59
## Initial Build
24
60
25
61
Launch the install and build ** for doing development:**
26
62
63
+ ** Note** : If you installed ` pnpm ` locally (instead of globally), simply run ` npm run ` in place of ` pnpm ` to execute
64
+ these commands via [ NPM run scripts] ( https://docs.npmjs.com/cli/v10/using-npm/scripts ) .
65
+
27
66
``` sh
28
67
~ /cocalc/src$ pnpm make-dev
29
68
```
0 commit comments