In the pycharm, go to File->settings->project Interpreter
Then click the right top corner + button you will get pop up window to install packages. Then search for openpyxl you will get the latest package. Then click Install package to install it.
In the pycharm, go to File->settings->project Interpreter
Then click the right top corner + button you will get pop up window to install packages. Then search for openpyxl you will get the latest package. Then click Install package to install it.
Exactly how user5777975 explained however on some systems "Project Interpreter" is named "Python Interpreter" and the interface is slightly different.
So:
In the pycharm, go to File->settings->Python Interpreter Then click the + button ion the top left of the table of installed packages, you will get pop up window to install packages. Then search for openpyxl and you will get the latest package (default option). Then click Install package to install it. You will get notification if successful.
Trying to import openpyxl but error occurs
python - How to install openpyxl in PyCharm as I am getting this error message - Stack Overflow
how to fix "no module named openpyxl " in (pycharm) python 3.7? - Stack Overflow
Use pip or conda to install openpyxl - Getting Started - Datalore Forum
I am trying to install openpyxl in pycharm using pip install openpyxl, however when I import the openpyxl module, an error occurs.
I am using Pycharm on Ubuntu tho.
What I typed in terminal to install openpyxl:
pip install openpyxl
What returned:
Traceback (most recent call last):
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/bin/pip", line 7, in <module>
from pip._internal.cli.main import main
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/configuration.py", line 26, in <module>
from pip._internal.utils.logging import getLogger
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 13, in <module>
from pip._internal.utils.misc import ensure_dir
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 40, in <module>
from pip._internal.locations import get_major_minor_version, site_packages, user_site
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/locations/__init__.py", line 14, in <module>
from . import _distutils, _sysconfig
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/venv/lib/python3.8/site-packages/pip/_internal/locations/_distutils.py", line 9, in <module>
from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'
And here's my code:
import openpyxl as xl
wb = xl.load_workbook('translations.xlsx')
sheet = wb['Sheet1']
cell = sheet['a1']
print(cell)
and this is what comes when it runs:
File "/home/sheikhmugees/PycharmProjects/Python with Mosh/main.py", line 1, in <module>
import openpyxl as xl
ModuleNotFoundError: No module named 'openpyxl'


