Skip to content

Wrong python interpreter on windows #4584

Description

@RainbowC0

Describe the Bug

C:\Users\RainbowC>where python
D:\Programs\python\python.exe
D:\Programs\msys64\clang64\bin\python.exe

But when starting pyrefly lsp with D:\Programs\python\python.exe -m pyrefly lsp, and even appended --python-interpreter-path=D:\Programs\python\python.exe, it will always load packages from D:\Programs\msys64\clang64\bin\python.exe and results in import errors like:

import pandas as pd
'''Cannot find module `pandas`
  Looked in these locations (from config in `d:\projects\MultimodalMutationsPDAC\pyrefly.toml`):
  Import root (inferred from project layout): "d:\\projects\\MultimodalMutationsPDAC"
  Site package path queried from interpreter: ["D:\\Programs\\msys64\\clang64\\lib\\python3.12\\lib-dynload", "D:\\Programs\\msys64\\clang64\\lib\\python3.12\\site-packages", "D:\\Programs\\msys64\\clang64\\lib\\python3.12\\site-packages\\win32", "D:\\Programs\\msys64\\clang64\\lib\\python3.12\\site-packages\\win32\\lib", "D:\\Programs\\msys64\\clang64\\lib\\python3.12\\site-packages\\Pythonwin"]'''

only if I added the python-interpreter-path option in pyrefly.toml can this error eliminated.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions