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
When moving a folder within a python workspace to another location, all the modules that reference relative imports to another location outside the folder are not automatically updated.
The automatic update behavior is only executed when a single file is moved at once.
The same breaking behavior can be observed when multiple (2 or more) files are moved at the same time to a new folder.
Write out the structure that's given in the screenshot. (You can also find it as an attachment to this post.)
Drag and drop the "animal.py" file into the "new_source_module" folder.
Observe that the imports in the "human.py" are correctly updated to reflect the new location.
The import line changed from from ..source_modules.animal import Animal
to from ..new_source_modules.animal import Animal
Problematic behavior
Moving folders
Steps to Reproduce:
Write out the structure that's given in the screenshot. (You can also find it as an attachment to this post.)
Drag and drop the "source_modules" folder into the "new_source_module" folder.
Observe that the imports in the "human.py" are not updated to reflect the new locations.
Moving multiple files
Steps to Reproduce:
Write out the structure that's given in the screenshot. (You can also find it as an attachment to this post.)
Drag and drop the "animal.py" and "toy.py" files into the "new_source_module" folder.
Observe that the imports in the "human.py" are not updated to reflect the new locations.
Type: Bug
Behaviour
When moving a folder within a python workspace to another location, all the modules that reference relative imports to another location outside the folder are not automatically updated.
The automatic update behavior is only executed when a single file is moved at once.
The same breaking behavior can be observed when multiple (2 or more) files are moved at the same time to a new folder.
Original structure:

As a screenshot
As a zip
parent_folder.zip
Correct behavior
Moving a single file
Steps to Reproduce:
The import line changed from
from ..source_modules.animal import Animal
to
from ..new_source_modules.animal import Animal
Problematic behavior
Moving folders
Steps to Reproduce:
Moving multiple files
Steps to Reproduce:
See also the issue here
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2025.2.0
VS Code version: Code 1.98.2 (ddc367ed5c8936efe395cffeec279b04ffd7db78, 2025-03-12T13:32:45.399Z)
OS version: Windows_NT x64 10.0.19045
Modes:
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
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
A/B Experiments
The text was updated successfully, but these errors were encountered: