@@ -12,18 +12,57 @@ CoCalc is a pretty large and complicated project, and it will only work with the
1212. /cocalc/nvm/nvm.sh
1313```
1414
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:
1625
1726``` sh
1827npm install -g pnpm
1928```
2029
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.
2258
2359## Initial Build
2460
2561Launch the install and build ** for doing development:**
2662
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+
2766``` sh
2867~ /cocalc/src$ pnpm make-dev
2968```
0 commit comments