[Python] Sublime Text: Python module missing after update

Discussão em 'Python' iniciado por Stack, Dezembro 22, 2024.

  1. Stack

    Stack Membro Participativo

    I recently installed pandas through Anaconda and have been using it fine. I just updated my Sublime Text through the automatic update, and now Sublime Text cannot find my pandas.

    I tried uninstalling and reinstalling Sublime Text and reverting to a freshly installed state by following: https://www.sublimetext.com/docs/revert.html, but it only made the file path weirder and more wrong when I just try to import pandas:

    import pandas


    I get the result:

    ModuleNotFoundError: No module named 'pandas'
    [Finished in 104ms with exit code 1]
    [cmd: ['python3', '-u', 'file_path']]
    [dir: directory_path]
    [path: /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/TeX/texbin]


    I am on Mac OS Sonoma 14.6.1 with Sublime Text Build 4189.

    If I run

    import sys
    print(sys.executable)
    print(sys.version)


    I get

    /Library/Developer/CommandLineTools/usr/bin/python3
    3.9.6 (default, Feb 3 2024, 15:58:28)


    The path is not the same as it was before the update, before it was in

    /usr/bin/python 3


    Also there is an issue that if I run from Terminal

    python -V


    I get

    Python 3.12.7


    which does not match the version that Sublime Text is using. I have tried uninstalling and reinstalling Sublime Text

    My python3.sublime-build file is:

    {
    "cmd": ["python3", "-u", "$file"],
    "file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
    "selector": "source.python"
    }


    I have also tried:

    {
    "cmd": ["/usr/bin/python3", "-u", "$file"],
    "file_regex": "^ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
    }


    but this does not change anything.

    Continue reading...

Compartilhe esta Página