Building and compiling Python apps could be troublesome chiefly when copy-and-pasting another code from the internet without installing or importing the module itself. Sound familiar?! Here’s a nugget for any other error being: No module named <package-name> here
as the common one-size-fits-all solution.
Prerequisites
- Python 3
- pip
Solution
Step 1. cd
to your Python project virtual env directory.
Related: Create, manage and remove virtual environments in Python.
Step 2. Install the required missing module.
pip install --upgrade <insert-package-name-here>
Note(s):
- If the above command doesn’t work, try adding
sudo
in front. - Or, even replace
pip
withpip3
. - Make sure to check in case the module is already deprecated.
Conclusion
Related posts:
- Resolve: No module named apiclient.discovery in Python.
- Resolve: No module named oauth2client in Python.
Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.