hello-world
raw JSON → 0.2 verified Mon Apr 27 auth: no python
A simple Python package that prints 'Hello, World!' as a demonstration of PyPI publishing. Current version 0.2.
pip install hello-world Common errors
error ModuleNotFoundError: No module named 'hello-world' ↓
cause Using hyphen in import instead of underscore.
fix
Use 'import hello_world' (underscore).
error AttributeError: module 'hello_world' has no attribute 'hello_world' ↓
cause Assuming the function is named hello_world.
fix
Use hello_world.hello().
Warnings
gotcha Package name uses hyphen 'hello-world' but import uses underscore 'hello_world'. This is a common Python convention. ↓
fix Use 'import hello_world'.
gotcha The main function is called 'hello()', not 'hello_world()'. Check the source if in doubt. ↓
fix Call hello_world.hello().
Imports
- hello_world wrong
import hello-worldcorrectimport hello_world
Quickstart
import hello_world
hello_world.hello()