# How can I change code colors in Jupyter-lab installed via pip?

**URL:** <https://discourse.jupyter.org/t/how-can-i-change-code-colors-in-jupyter-lab-installed-via-pip/20147>\
**Category:** JupyterLab\
**Created:** [June 28, 2023, 3:59pm UTC](https://discourse.jupyter.org/t/how-can-i-change-code-colors-in-jupyter-lab-installed-via-pip/20147 "2023-06-28T15:59:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Berg](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/berg/32/9281_2.png) [@Berg](https://discourse.jupyter.org/u/Berg)\
**Post date:** [June 28, 2023, 3:59pm UTC](https://discourse.jupyter.org/t/how-can-i-change-code-colors-in-jupyter-lab-installed-via-pip/20147/1 "2023-06-28T15:59:59Z")

</div>

How can I change the colors of code instructions in Jupyterlab installed via pip? For Anaconda I do it through the index.css file but for Jupyterlab installed via pip I don’t know how to customize the code colors. For example, changing the green color of “import” to purple and some others.

![LB51u](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/f/f4245ad6feee92eca21150af142167e233eb424e.png)

---

<div class="post-metadata">

**Author:** ![spookster](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/spookster/32/8939_2.png) [@spookster](https://discourse.jupyter.org/u/spookster)\
**Post date:** [June 28, 2023, 4:18pm UTC](https://discourse.jupyter.org/t/how-can-i-change-code-colors-in-jupyter-lab-installed-via-pip/20147/2 "2023-06-28T16:18:52Z")

</div>

the default themes rest @ `~/.local/share/jupyter/lab/themes` if installed at user level.  
otherwise it should be in `/usr/share/...`.

the colors are defined in the index.css files, and syntax colors are in this block :

```auto
/* Code mirror specific styles */

  --jp-mirror-editor-keyword-color: #008000;
  --jp-mirror-editor-atom-color: #88f;
  --jp-mirror-editor-number-color: #080;
  --jp-mirror-editor-def-color: #00f;
  --jp-mirror-editor-variable-color: var(--md-grey-900);
  --jp-mirror-editor-variable-2-color: rgb(0, 54, 109);
  --jp-mirror-editor-variable-3-color: #085;
  --jp-mirror-editor-punctuation-color: #05a;
  --jp-mirror-editor-property-color: #05a;
  --jp-mirror-editor-operator-color: #a2f;
  --jp-mirror-editor-comment-color: #408080;
  --jp-mirror-editor-string-color: #ba2121;
  --jp-mirror-editor-string-2-color: #708;
  --jp-mirror-editor-meta-color: #a2f;
  --jp-mirror-editor-qualifier-color: #555;
  --jp-mirror-editor-builtin-color: #008000;
  --jp-mirror-editor-bracket-color: #997;
  --jp-mirror-editor-tag-color: #170;
  --jp-mirror-editor-attribute-color: #00c;
  --jp-mirror-editor-header-color: blue;
  --jp-mirror-editor-quote-color: #090;
  --jp-mirror-editor-link-color: #00c;
  --jp-mirror-editor-error-color: #f00;
  --jp-mirror-editor-hr-color: #999;

```

import is a keyword so you’d have to change the first variable.

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [June 28, 2023, 4:24pm UTC](https://discourse.jupyter.org/t/how-can-i-change-code-colors-in-jupyter-lab-installed-via-pip/20147/3 "2023-06-28T16:24:19Z")

</div>

Cross-posted [here on StackOverflow](https://stackoverflow.com/q/76567124/8508004).

---

<div class="post-metadata">

**Author:** ![Berg](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/berg/32/9281_2.png) [@Berg](https://discourse.jupyter.org/u/Berg)\
**Post date:** [June 28, 2023, 7:08pm UTC](https://discourse.jupyter.org/t/how-can-i-change-code-colors-in-jupyter-lab-installed-via-pip/20147/4 "2023-06-28T19:08:34Z")

</div>

I mean when Jupyter is installed via PIP, these folder theme and the index.css file do not exist, only when installing via Anaconda.

---

<div class="post-metadata">

**Author:** ![spookster](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/spookster/32/8939_2.png) [@spookster](https://discourse.jupyter.org/u/spookster)\
**Post date:** [June 28, 2023, 11:43pm UTC](https://discourse.jupyter.org/t/how-can-i-change-code-colors-in-jupyter-lab-installed-via-pip/20147/5 "2023-06-28T23:43:16Z")

</div>

i have never used anaconda and installed jupyterlab via pip and i do have these folders. are you on windows, mac or linux?

edit: run `jupyter --paths` and check directories under data.

---

<div class="post-metadata">

**Author:** ![Berg](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/berg/32/9281_2.png) [@Berg](https://discourse.jupyter.org/u/Berg)\
**Post date:** [June 29, 2023, 12:37am UTC](https://discourse.jupyter.org/t/how-can-i-change-code-colors-in-jupyter-lab-installed-via-pip/20147/6 "2023-06-29T00:37:28Z")

</div>

Thank you so much. You saved the day… success !!

I found on the path: @~/AppData/Local/Programs/Python/Python311/share/jupyter/lab/themes
