ModuleNotFoundError: No module named 'mysql' in windows powershell - python

I have successfully installed mysql-connector.I am running a python program "videos.py" in windows powershell.
But still I am getting the error saying :
Traceback (most recent call last):
File ".\videos.py", line 1, in <module>
from db import conn, update, select, insert
File "C:\wamp64\www\cvm\python\db.py", line 1, in <module>
import mysql.connector
ModuleNotFoundError: No module named 'mysql'
I have tried with
pip install mysql-connector-python-rf
pip install mysql-connector
pip list
and I see mysql-connector in the list
But yet there is the same error.

Related

Getting error while importing win32com module

I installed the pywin32 module in my system. But when I import the "win32com" module getting the error as shown below.
Error:-
Traceback (most recent call last):
File "C:\Users\Lenovo\Desktop\script.py", line 1, in <module>
import win32com.client
ModuleNotFoundError: No module named 'win32com'
any idea on this
Try install: pip install pypiwin32

Why is my psycopg2 not working with python3?

I am trying to run a simple python script to connect to my local postgresl db. I am on a mac and after doing a pip install psycopg2 and pip install psycopg2-binary I still get a module not found error in my simple script.
Python 3.8.1
Error:
Traceback (most recent call last):
File "test.py", line 1, in <module>
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
test.py:
import psycopg2

how can I import module if an installed one is incorrect?

I'm getting below error:
Traceback (most recent call last):
File "TicketGeneration_test.py", line 6, in <module>
from MysqlConnection import SQLConnection
File "/Users/ashish.kumar/MerchantRisk/June5th/reports/MysqlConnection.py", line 1, in <module>
import MySQLdb
ImportError: No module named MySQLdb
I've already tried :
pip install MySQL-python
pip install mysqlclient
My python version is Python 2.7.16

ModuleNotFoundError: No module named 'future'

I have a Python script that I am trying to run in Linux via a bash script called ./launch.sh. When I launch the code I get the following error returned.
[user#localhost mktdata.out]$ ./launch.sh
[user#localhost mktdata.out]$ Traceback (most recent call last):
File "strats/merlin.py", line 10, in <module>
File "strats/merlin/mktdata.py", line 11, in <module>
File "strats/dao/utils/itertools.py", line 1, in <module>
ModuleNotFoundError: No module named 'future'
Line 1 in the Python script itertools.py line 1 that the error is referring to is:
from future.moves.itertools import zip_longest
Is there a package that I need to install in order for this code to work?
You need to import future like this:
from __future__ import *
In the event that fails, use pip to install it like this (Use sudo for MAC):
pip install future
Here is more on installing future.

Issues related to psycopg2

I am running EPD python 2.7.3. I have installed psycopg2 by easy_install . But When i try to import the psycopg2, It shows the following error:
>>>import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: _PQbackendPID
Referenced from: /Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/psycopg2/_psycopg.so
Expected in: dynamic lookup
I am runnin mac osx Mountain lion. Any suggestion?
it should work, i installed with $ sudo apt-get command on Ubuntu. everything work fine. may try to uninstall the postgresql and reinstall it.

Categories