Skip to content

Commit 05337a5

Browse files
authored
Merge pull request #1009 from joshitha1808/fix-colab-tpu-runtime
Fix Google Colab dependency conflicts for malariagen_data
2 parents 3d382a0 + 0288ac8 commit 05337a5

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ To get setup for development, see [this video if you prefer VS Code](https://you
4949
For detailed setup instructions, see:
5050
- [Linux setup guide](LINUX_SETUP.md)
5151
- [macOS setup guide](MACOS_SETUP.md)
52+
- [Google Colab (TPU) setup guide](docs/source/colab_tpu_runtime.rst)
5253
Detailed instructions can be found in the [Contributors guide](https://github.com/malariagen/malariagen-data-python/blob/master/CONTRIBUTING.md).
5354

5455
## AI use policy and guidelines

docs/source/colab_tpu_runtime.rst

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
Google Colab Installation Guide
2+
===============================
3+
Prerequisites
4+
-------------
5+
6+
Before installing the package, configure the runtime environment
7+
correctly:
8+
9+
1. Open a new notebook in Google Colab.
10+
2. Navigate to ``Runtime → Change runtime type``.
11+
3. Set the runtime configuration as follows:
12+
13+
- **Runtime type:** Python 3
14+
- **Hardware accelerator:** TPU
15+
- **TPU type:** v2-8
16+
17+
4. Click **Save** to apply the configuration.
18+
19+
Using the recommended TPU configuration ensures compatibility with
20+
workflows that may require TPU-based computation.
21+
22+
23+
Installation Procedure
24+
----------------------
25+
26+
In a new notebook cell, install the package:
27+
28+
.. code-block:: bash
29+
30+
!pip install malariagen_data
31+
32+
After installation completes, verify that the package is available:
33+
34+
.. code-block:: python
35+
36+
import malariagen_data
37+
38+
If the import executes without errors, the installation was successful.
39+
40+
If dependency-related warnings or conflicts occur, follow one of the
41+
resolution options described below.
42+
43+
44+
Resolution Options
45+
------------------
46+
47+
Resolution Option 1: Uninstall Panel
48+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49+
50+
If your notebook does not require ``panel``, uninstall it before
51+
installing ``malariagen_data``.
52+
53+
.. code-block:: bash
54+
55+
!pip uninstall -y panel
56+
!pip install malariagen_data
57+
58+
Verify installation:
59+
60+
.. code-block:: python
61+
62+
import malariagen_data
63+
64+
65+
Resolution Option 2: Install Compatible Panel Version
66+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67+
68+
If your workflow depends on ``panel``, install a compatible version:
69+
70+
.. code-block:: bash
71+
72+
!pip install panel==1.7.0
73+
!pip install malariagen_data
74+
75+
Restart the runtime:
76+
77+
``Runtime → Restart runtime``
78+
79+
Then verify:
80+
81+
.. code-block:: python
82+
83+
import malariagen_data
84+
85+
86+
Resolution Option 3: Install Required Blinker Version
87+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88+
89+
If a ``blinker`` version conflict occurs:
90+
91+
.. code-block:: bash
92+
93+
!pip install blinker==1.9.0 --ignore-installed
94+
!pip install malariagen_data
95+
96+
Restart the runtime and verify:
97+
98+
.. code-block:: python
99+
100+
import malariagen_data
101+
102+
103+
Final Verification
104+
------------------
105+
106+
After completing any of the procedures above:
107+
108+
- Ensure that ``malariagen_data`` installs without dependency errors.
109+
- Confirm that ``import malariagen_data`` runs successfully.
110+
- Restart the runtime whenever core dependencies are modified.
111+
- Avoid mixing incompatible package versions within the same Colab session.

0 commit comments

Comments
 (0)