Skip to content

Conda env defined $PYTHONPATH is ignored - breaks pylint, refactoring,... #13962

Closed
@TotallyFred

Description

@TotallyFred

Issue Type: Bug

I set up Code Studio to use a conda environment called LMCrypto for my project.

Here is the content from settings.json that was generated by selecting the environment from the bottom left blue status line:

(LMCrypto)# cat ../.vscode/settings.json
{
"python.pythonPath": "/Users/fdetienn/anaconda3/envs/LMCrypto/bin/python"
}

This environment contains a PYTHONPATH:

(LMCrypto)# echo $PYTHONPATH
/Users/fdetienn/Documents/Programming/LazyMaestro/standalone/lmcrypto

When CodeStudio runs pylint (upon saving the file), all the import for my own modules are underlined in red with a pylint-import error .

When I run pylint from a terminal (including in code studio's terminal), pylint properly detects the import path from PYTHONPATH.

I.e. the problem only appears when Code Studio runs pylint on its own.

Seemingly, code refactoring is also broken.

This was working nicely before my vacation and seems to have appeared with the latest upgrade.

Extension version: 2020.8.109390
VS Code version: Code 1.49.0 (e790b931385d72cf5669fcefc51cdf65990efa5d, 2020-09-10T17:39:53.251Z)
OS version: Darwin x64 19.6.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 3
Memory (System) 16.00GB (0.10GB free)
Process Argv
Screen Reader no
VM 0%

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions