1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] VS code cannot import local python modules

Discussão em 'Python' iniciado por Stack, Agosto 1, 2025.

  1. Stack

    Stack Membro Participativo

    All of my project files in VS code suddenly gives an error saying that it cannot import modules (even tho the modules are local i.e same directory and they used to work pretty well before). The code works fine in pycharm but not in VS code, any idea whats going on?

    Code:
    from backend.util.crypto_hash import crypto_hash
    from backend.config import MINE_RATE

    error:


    env DEBUGPY_LAUNCHER_PORT=34625 /home/nikhil/python-blockchain/blockchain-env/bin/python /home/nikhil/.vscode/extensions/ms-python.python-2020.3.71659/pythonFiles/lib/python/debugpy/no_wheels/debugpy/launcher /home/nikhil/python-blockchain/backend/app/__init__.py
    Traceback (most recent call last):
    File "/home/nikhil/python-blockchain/backend/app/__init__.py", line 2, in <module>
    from backend.blockchain.blockchain import Blockchain
    ModuleNotFoundError: No module named 'backend'

    Continue reading...

Compartilhe esta Página