Skip to content

Tag: python

VSCode Python Test Discovery fails?

VS Code version: version Version: 1.69.2 (Universal)) Extension version (available under the Extensions sidebar): v2021.12.1559732655 OS and version: MacOS 12.3.1 Python version: 3.6.8 Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv Relevant/affected Python packages and thei…

How to import module in different folder?

I have this folder structure: and I want to import x.py when running main.py. I added to main.py. But I received a ModuleNotFoundError How can I solve this error? Answer Don’t run a script inside a package. Python files inside packages are intended to be imported, not to be run(*) Instead, move the scri…