You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Add base image details and Python version management guide
- Added comprehensive base image section with complete Dockerfile
- Documented Python 3.13 default and available tools
- Added guides for using pyenv and uv for different Python versions
- Included virtual environment best practices for compatibility
- Added setup command examples for Python version management
Addresses customer support request for Python 3.12 compatibility with packages like argis==2.4.0
&& curl -fsSL https://raw.githubusercontent.com/coder/code-server/refs/tags/v4.99.1/install.sh | sh \
107
+
&& uv tool install uvicorn[standard]
108
+
109
+
ENTRYPOINT ["/usr/local/bin/start.sh"]
110
+
```
111
+
112
+
</details>
113
+
114
+
## Working with Different Python Versions
115
+
116
+
The sandbox comes with Python 3.13 by default, but some packages may not yet be compatible with this version. Here are strategies for handling different Python versions:
117
+
118
+
### Using pyenv for Multiple Python Versions
119
+
120
+
If you need to work with a different Python version, you can install and use `pyenv`:
121
+
122
+
```bash
123
+
# Install pyenv
124
+
curl https://pyenv.run | bash
125
+
126
+
# Add pyenv to PATH (for current session)
127
+
export PATH="$HOME/.pyenv/bin:$PATH"
128
+
eval"$(pyenv init -)"
129
+
eval"$(pyenv virtualenv-init -)"
130
+
131
+
# Install Python 3.12 (or your desired version)
132
+
pyenv install 3.12.0
133
+
134
+
# Set Python 3.12 as the local version for your project
135
+
pyenv local 3.12.0
136
+
137
+
# Create a virtual environment with Python 3.12
138
+
python -m venv venv
139
+
source venv/bin/activate
140
+
141
+
# Install your dependencies
142
+
pip install -r requirements.txt
143
+
```
144
+
145
+
### Using uv with Specific Python Versions
146
+
147
+
The `uv` package manager (already installed) can also manage Python versions:
148
+
149
+
```bash
150
+
# Install a specific Python version with uv
151
+
uv python install 3.12
152
+
153
+
# Create a project with a specific Python version
154
+
uv init --python 3.12 my_project
155
+
cd my_project
156
+
157
+
# Install dependencies with the specified Python version
158
+
uv add your-package-name
159
+
```
160
+
161
+
### Virtual Environment Best Practices
162
+
163
+
When working with packages that require older Python versions:
164
+
165
+
```bash
166
+
# Create a virtual environment with a specific Python version
167
+
python3.12 -m venv venv_312
168
+
source venv_312/bin/activate
169
+
170
+
# Verify the Python version
171
+
python --version
172
+
173
+
# Install packages that require Python 3.12
174
+
pip install argis==2.4.0 # Example package that needs older Python
175
+
176
+
# Deactivate when done
177
+
deactivate
178
+
```
179
+
180
+
<Warning>
181
+
Remember to activate your virtual environment in your setup commands if you need specific Python versions for your project dependencies.
182
+
</Warning>
183
+
14
184
## Accessing Setup Commands
15
185
16
186
To configure setup commands for a repository:
@@ -48,7 +218,11 @@ npm install
48
218
```
49
219
50
220
```bash
51
-
# Install Python dependencies
221
+
# Setup with specific Python version for compatibility
222
+
pyenv install 3.12.0
223
+
pyenv local 3.12.0
224
+
python -m venv venv
225
+
source venv/bin/activate
52
226
pip install -r requirements.txt
53
227
```
54
228
@@ -67,3 +241,4 @@ npm run build
67
241
The environment variables listed in the "Env Variables" section are available
0 commit comments