-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Labels
area: code cellsIssues related to the Code Cells extensionIssues related to the Code Cells extensionenhancementNew feature or requestNew feature or requestlang: python
Milestone
Description
This is related to #3155 but might be considered a bug, so I'm opening a separate issue.
Positron Version:
Positron Version: 2024.05.0 (Universal) build 1251
Code - OSS Version: 1.89.0
Commit: c0d8830
Date: 2024-05-15T13:58:23.111Z
Electron: 28.2.8
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.4.0
Steps to reproduce the issue:
Create a project with the following structure:
.
└── scripts
├── _one.py
└── main.py
# scripts/_one.py
def hello_world():
return "Hello, World!"
# scripts/main.py
# %%
from _one import hello_world
hello_world()
In main.py
, click "Run Cell` above the import statement. The sends the code to the Python Console, resulting in a ModuleNotFoundError:
>>> from _one import hello_world
... hello_world()
ModuleNotFoundError: No module named '_one'
Cell In[1], line 1
----> 1 from _one import hello_world
2 hello_world()
What did you expect to happen?
In VS Code, with the Jupyter extension, clicking on Run Cell sends the code to an interpreter (that yes, is tied to the script) where the code is evaluated in the script's parent directory.
Were there any error messages in the output or Developer Tools console?
N/A
Metadata
Metadata
Assignees
Labels
area: code cellsIssues related to the Code Cells extensionIssues related to the Code Cells extensionenhancementNew feature or requestNew feature or requestlang: python