Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute code in Quarto Document #6541

Open
Nicky-Jin opened this issue Feb 28, 2025 · 1 comment
Open

Execute code in Quarto Document #6541

Nicky-Jin opened this issue Feb 28, 2025 · 1 comment
Assignees
Labels
area: quarto Issues related to Quarto category. area: reticulate Issues related to the reticulate extension bug Something isn't working

Comments

@Nicky-Jin
Copy link

Type: Bug

I have both code cells of Python and R. However, when I click the "Run Cell" above the code cell, it is always excuted in R, even if it is a Python cell. For example, my code cell like:

import numpy as np
import pandas as pd
import scanpy as sc
import os
os.getcwd()

I have specified the code type with ```{python}

If I click "Run Cell", it will run in R console and report error.

VS Code version: Positron 1.96.0 (5e22d6f, 2025-02-25T20:39:11.000Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 6.11.0-17-generic

System Info
Item Value
CPUs AMD Ryzen 7 5800H with Radeon Graphics (16 x 3194)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.86GB (20.96GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote SSH: 192.168.137.2
OS Linux x64 6.11.0-17-generic
CPUs Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz (48 x 2999)
Memory (System) 471.73GB (463.73GB free)
VM 0%
Extensions (4)
Extension Author (truncated) Version
debugpy ms- 2025.0.1
jupyter ms- 2024.11.0
jupyter-renderers ms- 1.1.0
js-debug ms- 1.97.1
@dfalbel
Copy link
Contributor

dfalbel commented Feb 28, 2025

Thanks for reporting @Nicky-Jin !
I believe this is related to: #3865

What's happening is that the Quarto extension is sending the python code to the R console using:

reticulate::repl_python(input="<chunk code> ")

And positron renders it in the R console. With #6529 the code will be sent to the Reticulate Python console.

@dfalbel dfalbel marked this as a duplicate of #6542 Feb 28, 2025
@dfalbel dfalbel marked this as a duplicate of #6543 Feb 28, 2025
@dfalbel dfalbel added area: quarto Issues related to Quarto category. area: reticulate Issues related to the reticulate extension labels Feb 28, 2025
@dfalbel dfalbel self-assigned this Feb 28, 2025
@dfalbel dfalbel added the bug Something isn't working label Feb 28, 2025
@dfalbel dfalbel added this to the 2025.04.0 Pre-Release milestone Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: quarto Issues related to Quarto category. area: reticulate Issues related to the reticulate extension bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants