3 ms·
I've been out of python for a while, why is the package name and the module name different? `install many-requests` vs `import many_requests`
by texuf 6y ago
I've been out of python for a while, why is the package name and the module name different? `install many-requests` vs `import many_requests`
- stevesimmons 6y agomany-requests is the name the package was registered with on pypi.org. So you install with: pip install many-requests. That installation creates a folder named many_requests inside the site-packages directory on your PYTHON_PATH. It uses underscore rather than hyphen because modules/packages must be legal Python names. A hyphen would be parsed as subtraction.
- comfydragon 6y ago> It uses underscore rather than hyphen because modules/packages must be legal Python names. A hyphen would be parsed as subtraction. And inversely, PyPI normalizes the package name (the name you give to `pip install`) to use hyphens instead of underscores. https://www.python.org/dev/peps/pep-0503/#normalized-names https://www.python.org/dev/peps/pep-0503/#normalized-names