Reputation: 11
I'm trying to use python to modify an excel file. I understand the code necessary to do it, my problem is that my python program, from here, won't let me import the right modules (eg. openpyxl). It just throws up a module not found error. What do I have to do/download to allow it to find the modules. Thanks!
Upvotes: 1
Views: 470
Reputation: 43
I think both of the prior two answers should cover what you're trying to do. The only thing I'd like to add is that if you're on a windows machine, and pip is not in the path, you may need to try typing into a command prompt:
python -m pip install openpyxl
Upvotes: 1
Reputation: 11
First, you have to install pip which is a package manager for Python packages/modules.
2. Open Command Prompt(Windows)/terminal(MacOS)
Run command:
pip install openpyxl
If you need to install any other extra modules repeat 3
pip install 'module_name'
Upvotes: 1
Reputation: 3155
Open terminal if on MacOS or Command Prompt if on Windows
Run command (replace package_name with the name of the module you want to install:
pip install package_name
This method holds true for most of the python libraries that are available. The command installs the latest version of the module that you specify along with its dependencies from the Python Package Index
The Python Package Index (PyPI) is a repository of software for the Python programming language.
From: pypi.org
Upvotes: 1