Python : Module not found - python

When I use pip freeze command, it returns
C:\Users\Keshav Reddy>pip freeze
Warning: cannot find svn location for guippy===0.1.5dev-r0
beautifulsoup4==4.4.1
future==0.15.2
## FIXME: could not find svn URL in dependency_links for this package:
guippy===0.1.5dev-r0
keyboard==0.6.5
Pillow==3.1.1
PyAutoGUI==0.9.33
PyMsgBox==1.0.3
pypiwin32==219
PyScreeze==0.1.8
python-subprocess2==0.2.1
PyTweening==1.0.3
pywinauto==0.5.4
requests==2.9.1
robotframework==3.0
SimplePool==0.1
urlopen==1.0.0
virtualenv==14.0.6
but I couldn't import any of these modules.
C:\Users\Keshav Reddy>python
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyautogui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'pyautogui'
How can I import these modules?

Begin by installing a release of 'guippy' module.

Have you tried downloading Anaconda? It helps alot with downloading modules.

Related

installed opencv but cant import it in both vscode and IDLE

(base) PS C:\Users\LENOVO> pip install opencv-python
Requirement already satisfied: opencv-python in c:\users\lenovo\anaconda3\lib\site-packages (4.7.0.68)
Requirement already satisfied: numpy>=1.17.0 in c:\users\lenovo\anaconda3\lib\site-packages (from opencv-python) (1.21.5)
(base) PS C:\Users\LENOVO> py
Python 3.9.11 (tags/v3.9.11:2de452f, Mar 16 2022, 14:33:45) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import cv2
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'cv2'
``Python 3.9.11 (tags/v3.9.11:2de452f, Mar 16 2022, 14:33:45) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
import cv2 as cv
Traceback (most recent call last):
File "<pyshell#0>", line 1, in
import cv2 as cv
ModuleNotFoundError: No module named 'cv2'
`
how do i solve this
(base) PS C:\Users\LENOVO> pip install opencv-python
Requirement already satisfied: opencv-python in c:\users\lenovo\anaconda3\lib\site-packages (4.7.0.68)
Requirement already satisfied: numpy>=1.17.0 in c:\users\lenovo\anaconda3\lib\site-packages (from opencv-python) (1.21.5)
(base) PS C:\Users\LENOVO> py
Python 3.9.11 (tags/v3.9.11:2de452f, Mar 16 2022, 14:33:45) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import cv2
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'cv2'
this is what i wanted to do import open cv it has been installed via anaconda

Can not import an already installed package module

I want to install a package called Xsequence https://github.com/fscarlier/xsequence
in Windows vie git clone command and then I used python to install it
git clone https://github.com/fscarlier/xsequence.git
cd xsequence_master
python setup.py install
I have several python versions installed, put the one that was used in the installation was in the first path.
C:\Users\musa\AppData\Local\Programs\Python\Python310\python.exe
C:\Users\musa\Anaconda3\python.exe
C:\Users\musa\AppData\Local\Microsoft\WindowsApps\python.exe
The issue is that when I import the package Xsequence it works fine,
But when I try to import any other module from inside this package it doesn't work
Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xsequence
>>> from xsequence.lattice import Lattice
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\musa\AppData\Local\Programs\Python\Python310\lib\site-packages\xsequence-0.0.0-py3.10.egg\xsequence\lattice.py", line 11, in <module>
File "C:\Users\musa\AppData\Local\Programs\Python\Python310\lib\site-packages\xsequence-0.0.0-py3.10.egg\xsequence\elements.py", line 13, in <module>
ModuleNotFoundError: No module named 'xsequence.helpers'
I checked the package folder manually it contains the module Xsequence.helper.
The strange thing that all the module can be imported if I run python directly after instilling the setp.py but once I closed the terminal its not imported anymore

Python 3 cannot import socket in CMD but available in IDLE

I have installed python 3.7 on my computer. It seems not possible to import socket in CMD:
C:\Users\Sina\py
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python37-32\lib\socket.py", line 49, in <module>
import _socket
ImportError: Module use of python27.dll conflicts with this version of
Python.
>>>
But surprisingly, I am able to import socket in IDLE (Python 3.7).
I searched but didn't find any 'python27.dll' file in the installation directory
of python 3.7 (C:\Python37-32)
EDIT: There was a _socket.pyd file at "C:\Users\Sina" which used to make the confliction. I deleted it and the problem got fixed. Thanks to Aran-Fey!

no module named matplotlib on windows

Facing this issue right now, saw the question:
no module named pylab on windows
I have annaconda and python 2.7 installed. I tried in the python shell:
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named matplotlib
and received the following result. I've checked my PATH variable, and I'm not sure how to resolve.
Thanks in advance.

“ImportError: No module named scipy” after installing the scipy package

I need help with the scipy Python module. I installed it, but when I try to import it, I get an error (no module named scipy). Why?
Here's the output from my Python interpreter:
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import scipy
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import scipy
ImportError: No module named scipy

Categories