Tutorials
Practical tutorials for the work we actually do. Pick one, read it in order, and apply it.
Reproduce an interpreter mismatch, compare executable, pip and module paths, then verify the repair from the Python environment that runs the application.
ModuleNotFoundError has a handful of causes: the wrong Python, an inactive virtual environment, the wrong folder, or a file that shadows a module. Check them in order instead of reinstalling.
Importing a file runs it. if __name__ == "__main__" keeps a file's script part from running when another file imports it. Use it with a main() function, and know the cases where you don't need it.
pip freeze gives exact versions but hides what you chose. A hand-written file shows what you chose but isn't exact. For anything you deploy, keep both: one file for intent, one frozen for exact versions.
The file was loaded as a classic script or CommonJS, where import isn't allowed. The fix in the browser is type="module". In Node it's "type": "module" or .mjs, and recent npm init writes "type": "commonjs" for you.
Install the LTS version of Node.js, check the installer's signature, and prove it works in a new terminal with node -v, npm -v and one real install. Plus the fixes for "not recognized" and the wrong version showing.
Use npm ci to install exactly what the lock file says and npm install to change it. What each command does, when to use which, and how to fix "npm ci can only install packages when your package.json and package-lock.json are in sync".
Compare import type, the inline type keyword and a plain import, and see which ones leave code in the compiled file. After this, a types-only import cannot load a module with side effects.
Reproduce the missing declaration error, check whether the library has its own types, install the @types package and prove the types work. After this, you know the fallback when no types package exists.
Keep node_modules out of the build context with a .dockerignore file and let npm ci install the packages inside the image. After this, you can cut the context size and avoid copying Windows-built packages into a Linux image.