please help me im deadless i cant do anything im sad im mad
I'm working on a program that uses excel files, so I installed openpyxl (also pandas and rich). It worked previously (like a month or so ago) but when I went back to it today, VScode is saying that the modules can not be found and likewise python says they can not be found when I attempt to run it. I verified they are installed via pip but they still can not be found. So what's the deal? Is this a python problem or a VSCode problem?
EDIT: here is the code of the module.
Using Python 3.9.12 and on a Mac.
The code is really basic, I'm just attempting to use pandas to read an excel column. However it throws this error
ModuleNotFoundError: No module named 'openpyxl'
and
ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.
However, when I use pip list
it tells me that openpyxl is installed. And I've already uninstalled and reinstalled anacondas. Any help is greatly appreciated! And the code is below.
import pandas as pd
print("imported")
data = pd.read_excel("/Desktop/codes_sheet.xlsx")
print("data read")
df = pd.DataFrame(data, columns= ['codes'])
print(df)
print(type(df))Hello ! I'm new to python and i have a problem, im running VSC on my chromebook (i know), and when i want to import modules (like matplotlib or pandas) i get the same error message
"Import "pandas" could not be resolved from source Pylance(reportMissingModuleSource)"
It works fine on my other computer (running Windows) but not on this one. Is it a problem with Linux or something i forgot to do when downloading VSC maybe ?
I had the same problem solved using instead of pip or easy install one of the following commands :
sudo apt-get install python-openpyxl
sudo apt-get install python3-openpyxl
The sudo command also works better for other packages.
While not quite what you ran into here (since you state that you are using python 2.7), for those who run into this issue and are using python 3, you may be unintentionally installing to python 2 instead. To force the install to python 3 (instead of 2) use pip3 instead.
See this thread for more info: No module named 'openpyxl' - Python 3.4 - Ubuntu
Open the Command Palette (Ctrl+Shift+P), then select the Python: Select Interpreter. From the list, select the virtual environment in your project folder that starts with
.env.Run Terminal: Create New Integrated Terminal (Ctrl+Shift+` or from the Command Palette), which creates a terminal and automatically activates the virtual environment by running its activation script.
Install
sqlalchemyandmongoenginewith commandpip install. Once installing them successfully, there will intellisense when you import them and no warnings shown.

Besides, the folder .vscode is to store Workspace settings as well as debugging and task configurations.
To resolve the issue, perform the following steps:
- Open the Command Palette by pressing Ctrl+Shift+P on your keyboard.
- In the Command Palette, select Python: Clear Cache and Reload Window.



