ModuleNotFoundError: No module named 'PyMySQL' Mac OSX - macos

I am on Mac OSX (High Sierra, v 10.13.4)
I have installed the package pymysql successfully through command line. However, when I try to import pymysql in Jupyter Notebook (or in Visual Studio Code), I get the following error:
ModuleNotFoundError Traceback (most recent call last)
in ()
3
4 # PyMySQL
----> 5 import PyMySQL
6 #pymysql.install_as_MySQLdb()
ModuleNotFoundError: No module named 'PyMySQL'
Does anyone know what the problem could be? Thank you!

Related

'No module named 'pyfirmata'' error even though I have already installed pyfirmata using pip?

I started by uploading the StandardFirmata example from the Arduino IDE onto my Arduino UNO. I then successfully installed pyfirmata onto my windows pc using pip3 install pyfirmata to the path c:\users\ta319\anaconda3\lib\site-packages, however, when I try to run the following code in spyder:
#!/usr/bin/env python3
import pyfirmata
import time
if __name__ == '__main__':
board = pyfirmata.Arduino('COM4 (Arduino UNO)')
print("Communication Successfully started")
while True:
board.digital[13].write(1)
time.sleep(1)
board.digital[13].write(0)
time.sleep(1)
I get this error:
Traceback (most recent call last):
File
"C:\Users\ta319\AppData\Local\Programs\Spyder\pkgs\spyder_kernels\py3compat.py",
line 356, in compat_exec
exec(code, globals, locals)
File "c:\users\ta319\firmata setup.py", line 3, in
import pyfirmata
ModuleNotFoundError: No module named 'pyfirmata'
Any suggestions would be greatly appreciated, thanks!
You probably installed with pip and not pip3, try
python3 -m pip install pyfirmata or pip3 install pyfirmata

Pandas_datareader error in jupyter_notebook cannot find module via anaconda or pip, possible typo in package name?

There is a thread similar to my question, but mine is slightly different.I am using anaconda to run an environment with all the packages I am using. Running in python 3.7. I run jupyter notebook but the following gives me an error:
import pandas_datareader.data as web
Error:
ModuleNotFoundError Traceback (most recent call
last) in
----> 1 import pandas_datareader.data as web
ModuleNotFoundError: No module named 'pandas_datareader'
I noticed when I installed this module via anaconda:
conda install -c anaconda pandas-datareader
there is a hyphen in the module name (pandas-datareader) but when running import (above) there is an underscore. Could this be the problem?
I tried installing via pip and same error!

Cannot import open cv2 in python. Error: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel [[Cannot upgrade numpy ]]

I and trying to build something on python package cv2. My os is Mac OS X El Capitan and python version is python 2.7.10.
But when I import cv2 as
>>> import cv2
I get following error.
RuntimeError: module compiled against API version a but this version of numpy is 9
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: numpy.core.multiarray failed to import
I figured out that it is a problem of numpy version and I need to upgrade it. So I tried
sudo pip install numpy --upgrade
But system threw following error:
OSError: [Errno 1] Operation not permitted: '/tmp/pip-JSOF8d-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
Then I tried to install a particular version of numpy (required version) using following command.
pip install numpy==1.8
Even this didn't work and I got following traceback error:
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
Now I am clueless, how to proceed. Please help me to figure this out.
Thanks in advance.
I was also facing the same issue, 2 things which solved my problem are
Run
pip install --ignore-installed numpy
run the above command in terminal, that is don't use setuptools.
But, it will upgrade to latest version of numpy, hope this resolves your problem. Its been quite tough for me to fix couple of el-capitan issues

Installing PyQt4 in Mac OS X and Maya

I am trying to run PyQt4 in Maya 2014 and I keep getting the error that no modules was found etc.
I am a Mac user on OS X 10.7.5 and I have tried running the installation following this link as my guide.
Unfortunately though I am able to install everything as stated, but as I am unable to get the IDLE.app from MacPorts, thus I tried checking whether the PyQt4 is installed either by terminal or through Maya itself where I typed in from PyQt4.QtGui import *
However both methods still state the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4.QtGui
Can anyone help me through? Or do I still need to install something else just for Maya-usage?
It would seems that the python package in my machine is Python 2.7.1 as depicted from the terminal
For 2014+ you may want to use PySide, which comes with your Maya and won't need separate installation.

apportable : No module named argparse error on mac

i just installed apportable from here : http://www.apportable.com/users/1928
now , after installing successfully it gives this error :
Traceback (most recent call last):
File "/Users/macintosh/.apportable/SDK/bin/apportable", line 3, in
import argparse
ImportError: No module named argparse
i can understand it's import issue .. but i am not able to resolve this .. can anyone help on this !! i have tried this for many times & still same error .. what could be the possible resolution to this.
please help !
You may have an old python. You should have version 2.7+:
$ python --version
Python 2.7.2
Or old MacOS X. Apportable requires Mac OS X 10.7+.

Resources