ModuleNotFoundError in python even after installing the module - python

i run pip install openpyxl in cmd, and it installs successfully then i go in IDLE Shell and run import openpyxl
i get the error
ModuleNotFoundError: No module named 'openpyxl'
i don't know what's the problem here to recheck it i install another module pip install requests now when i call it in IDLE import requests i get the same error again
This error might be due to the reason that i have multiple virtual envs installed on my machine which i basically installed after following some udemy courses but i have no idea how those env work, the envs are installed on anaconda.
My Python Version is 3.9.1 and i am on windows 10

Related

I cannot install requests module on my computer

I get this error when I run my python project(I'm using python 3.10.5 on Windows 10):
ModuleNotFoundError: No module named 'requests'
Despite the fact that I do infact have the module installed. I also tried uninstalling it and installing it again, but that didn't work. I had a conflict on my other computer again with requests and installing discord.py, but I can't seem to get it to work here. I installed discord.py v2 using:
pip install -U git+https://github.com/Rapptz/discord.py
In Command Prompt Type: py -3 -m pip install requests
If it doesn't install, go to the given address and delete all the folders that say requests and upload again.

ImportError: No module named _____ -- in python

I'm having trouble importing modules such as pandas and BS4 in python on VScode, after pip installing them through terminal.
I receive the same error message "ImportError: No module named bs4" every time.
Any suggestions are greatly appreciated
Uninstall your Python and install it again.
Don't install packages through the VSCode terminal.
Install them outside the VSCode and then import them into your program.
For installing bs4, use the following command:
pip install beautifulsoup4

ModuleNotFoundError: No module named 'featuretools' even though I have installed featuretools

I keep getting the error ModuleNotFoundError: No module named 'featuretools' in Jupyter Notebook. However, it looks like it has been successfully installed when I install it in the terminal. I have tried installing it with pip install featuretools==0.27.0, pip -m install featuretools, and conda install -c conda-forge featuretools==0.27.0. I would appreciate suggestions on how to proceed.
It sounds like the featuretools library and the jupyter notebook library are installed in different python environments. Perhaps check out this question:
Unable to import a module from Python notebook in Jupyter
Ensuring the jupyter notebook library is installed in your expected environment may resolve this

ModuleNotFoundError: No module named 'pyodbc' even though pyodbc is installed

I have installed pyodbc inside my virtual environment(venv). However when I try to import this package it throws ModuleNotFoundError: No module named 'pyodbc'.
Below is the screenshot of what happen when I run pip install pyodbc
also, I can see pyodbc is installed on venv with the output of pip freeze. Please help me resolve this issue so that I can use pyodbc module in my virtual environment.

Pycharm throws: ModuleNotFoundError: No module named 'numpy' error even though Numpy is installed

When try to import numpy in pycharm it throws: ModuleNotFoundError: No module named 'numpy' error even though numpy is installed on the machine.
If I try to run the console it works perfectly.
pycharm creates its own virtual environment. But you have installed numpy in your system environment.
just open pychram console and run pip install numpy
There are two ways:
Easy way: Use GUI
File --> Settings --> Project Interpreter
Next you search for Numpy package and install desired package
Hard Way: Use command prompt
Go to terminal and upgrade pip first by typing the following
python -m pip install --upgrade pip
Next, install the package
pip install numpy
Verification
After installation is complete, please verify by typing following commands in console
import numpy as np
print (np.__version__)
Open pycharm console
Open File, Select ---> Settings, Select ---> Project Interpreter
Open the terminal and run the below command to upgrade pip.
python -m pip install --upgrade pip
run the commands to install the package
pip install numpy

Categories