mysql-python won't install on MacOS - sql

So I have tried multiple ways to install mysql-python and MYSQLdb. I have tried downloading through this link: https://sourceforge.net/projects/mysql-python/ and then when I run python setup.py install I get the following errors:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Traceback (most recent call last):
File "/Users/Jackson/Google Drive/CS520/HW/MySQL-python-1.2.4b4/distribute_setup.py", line 143, in use_setuptools
raise ImportError
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 7, in <module>
use_setuptools()
File "/Users/Jackson/Google Drive/CS520/HW/MySQL-python-1.2.4b4/distribute_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/Users/Jackson/Google Drive/CS520/HW/MySQL-python-1.2.4b4/distribute_setup.py", line 124, in _do_download
to_dir, download_delay)
File "/Users/Jackson/Google Drive/CS520/HW/MySQL-python-1.2.4b4/distribute_setup.py", line 194, in download_setuptools
src = urlopen(url)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Users/Jackson/anaconda3/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: SSL is required
I could not find a resolution that worked so I tried pip install mysql-python and then I get the following
Traceback (most recent call last):
File "setup.py", line 6, in <module>
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
NameError: name 'url' is not defined
Jacksons-MacBook-Pro:MySQL-python-1.2.4b4 Jackson$ pip install mysql-python
Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-kdgbz3qe/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/tmp/pip-build-kdgbz3qe/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-kdgbz3qe/mysql-python/
When I look this problem up I tried running:
pip install --upgrade setuptools
pip install ez_setup
easy_install -U setuptools
With no problems, but then when I tried rerunning the command pip install mysql-python I get the same error as before. I tried downloading the mysqlclient and the mysql/python connector and nothing is working. I just want a fix for trying to install mysql-python, mysqlclient, MYSQLdb, mysql/python connector or anything that will actually work. I already have mysql installed and running as well as Sequel Pro.

I could solve the issue by running the combination of #Devstr an #jsteele. I realized that the python module to connect from python to mysql is not mysql but ```mysql-connector``.
Follow these steps:
brew cask install mysql-connector-python
pip search mysql-connector | grep --color mysql-connector-python
pip install mysql-connector-python-rf
then in python:
import mysql.connector
...
found some useful info: What's the difference between MySQLdb, mysqlclient and MySQL connector/Python?

Maybe use brew?
brew cask install mysql-connector-python
see https://apple.stackexchange.com/questions/130324/how-to-install-mysql-utilities-using-brew-or-brew-cask#136180

Related

I install pyaudio many times But not working? ERROR: Cannot uninstall 'PyAudio'

ModuleNotFoundError: No module named 'pyaudio'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\Omkar_Bhatuse\Downloads\VoiceBot\Voice_bot.py", line 15, in
with sr.Microphone() as source:
File "C:\Users\Omkar_Bhatuse\Downloads\VoiceBot\venv\lib\site-packages\speech_recognition_init_.py", line 79, in init
self.pyaudio_module = self.get_pyaudio()
File "C:\Users\Omkar_Bhatuse\Downloads\VoiceBot\venv\lib\site-packages\speech_recognition_init_.py", line 110, in get_pyaudio
raise AttributeError("Could not find PyAudio; check installation")
AttributeError: Could not find PyAudio; check installation
(venv) PS C:\Users\Omkar_Bhatuse\Downloads\VoiceBot>
install it using command prompt then try to use the package from the site-packages folder in the python interrupter

Cannot import name 'wrap_module'

Im setting up an odoo community server and after adding and removing an addon, i am getting an error.
I have tried copying the odoo addons files back to the default install ones with no success.
Exception in thread odoo.service.cron.cron0:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/opt/odoo/odoo/odoo/service/server.py", line 244, in target
self.cron_thread(i)
File "/opt/odoo/odoo/odoo/service/server.py", line 218, in cron_thread
from odoo.addons.base.ir.ir_cron import ir_cron
File "/opt/odoo/odoo/odoo/modules/module.py", line 82, in load_module
exec(open(modfile, 'rb').read(), new_mod.__dict__)
File "<string>", line 4, in <module>
File "/opt/odoo/odoo/odoo/addons/base/ir/__init__.py", line 8, in
<module>
from . import ir_actions
File "/opt/odoo/odoo/odoo/addons/base/ir/ir_actions.py", line 8, in
<module>
from odoo.tools import pycompat, wrap_module
ImportError: cannot import name 'wrap_module'
That is the error i am getting, ive tried using pip3 to install pycompat but it still dosnt work.
Make sure you running Odoo on python3,
on terminal python3 path_to_odoo/./odoo-bin
and clear the browser cache and try again.

Cannot install or use scrapy on OS X -- blocked by proxy (I think)

So I am really having a tough time with something that should be very easy. AT work we have a lot of annoying proxies etc. and I'm pretty sure that's involved here. Anyhow, when I try to install scrapy, I get "Connection reset by peer" in the middle of downloading libxml, always 37% of the way in:
root#rcmac (~ ): pip install scrapy
Requirement already satisfied (use --upgrade to upgrade): scrapy in /Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg
Requirement already satisfied (use --upgrade to upgrade): Twisted>=10.0.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): w3lib>=1.8.0 in /Library/Python/2.7/site-packages (from scrapy)
Collecting queuelib (from scrapy)
Using cached queuelib-1.2.2-py2.py3-none-any.whl
Collecting lxml (from scrapy)
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading lxml-3.4.2.tar.gz (3.5MB)
37% |############ | 1.3MB 186kB/s eta 0:00:12 Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 246, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 345, in prepare_files
functools.partial(self._prepare_file, finder))
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 290, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 487, in _prepare_file
download_dir, do_download, session=self.session,
File "/Library/Python/2.7/site-packages/pip/download.py", line 827, in unpack_url
session,
File "/Library/Python/2.7/site-packages/pip/download.py", line 673, in unpack_http_url
from_path, content_type = _download_http_url(link, session, temp_dir)
File "/Library/Python/2.7/site-packages/pip/download.py", line 888, in _download_http_url
_download_url(resp, link, content_file)
File "/Library/Python/2.7/site-packages/pip/download.py", line 621, in _download_url
for chunk in progress_indicator(resp_read(4096), 4096):
File "/Library/Python/2.7/site-packages/pip/utils/ui.py", line 133, in iter
for x in it:
File "/Library/Python/2.7/site-packages/pip/download.py", line 586, in resp_read
decode_content=False):
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 273, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 203, in read
data = self._fp.read(amt)
File "/Library/Python/2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 49, in read
data = self.__fp.read(amt)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 567, in read
s = self.fp.read(amt)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 241, in recv
return self.read(buflen)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 160, in read
return self._sslobj.read(len)
error: [Errno 54] Connection reset by peer
I can get my hands on the libxml tarball, but I don't know how to get pip past this roadblock. I have somehow managed to get scrapy installed but it blows up when I try to import it:
root#rcmac (~ ): python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scrapy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg/scrapy/__init__.py", line 56, in <module>
from scrapy.spider import Spider
File "/Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg/scrapy/spider.py", line 7, in <module>
from scrapy.http import Request
File "/Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg/scrapy/http/__init__.py", line 11, in <module>
from scrapy.http.request.form import FormRequest
File "/Library/Python/2.7/site-packages/Scrapy-0.24.5-py2.7.egg/scrapy/http/request/form.py", line 9, in <module>
import lxml.html
ImportError: No module named lxml.html
So let's see: I guess my question is, "Help?" :-) thanks.
OK, solved again. Sorry. It looks like a proxy server here at work was blocking my lxml install from pip. I reran the pip install command for scrapy and lxml got properly installed at that point. After that, the error went away.

openerp server Import error: there is no module named gevent

I have installed Im module in my system(windows7) and I am trying to start server through
command line using openerp-server --gevent but getting below error
C:\Program Files\OpenERP 7.0-20140118-002423\Server\server>openerp-server --gevent
Traceback (most recent call last):
File "openerp-server", line 2, in <module>
File "C:\Program Files\OpenERP 7.0-20140118-002423\Server\server\.\openerp\__init__.py", line 40, in <module> import cli File "C:\Program Files\OpenERP 7.0-20140118-002423\Server\server\.\openerp\cli\__init__.py", line 3, in <module> import geventImportError: No module named gevent
just install it.
sudo pip install gevent

Could not install gsutil with latest version

I upgraded to the latest BQ (2.0.14) then downloaded the latest gsutil tar package and manually updated gsutil thus:
"python setup.py install"
When I run gsutil I now get the following error message:
Traceback (most recent call last):
File "/usr/local/bin/gsutil", line 8, in
load_entry_point('gsutil==3.31', 'console_scripts', 'gsutil')()
File "build/bdist.linux-i686/egg/pkg_resources.py", line 318, in load_entry_point
File "build/bdist.linux-i686/egg/pkg_resources.py", line 2221, in load_entry_point
File "build/bdist.linux-i686/egg/pkg_resources.py", line 1954, in load
File "/usr/local/lib/python2.7/site-packages/gsutil-3.31-py2.7.egg/gslib/main.py", line 32, in
from gslib import util
File "/usr/local/lib/python2.7/site-packages/gsutil-3.31-py2.7.egg/gslib/util.py", line 28, in
from oauth2client.client import HAS_CRYPTO
ImportError: cannot import name HAS_CRYPTO
I couldn't find a way to actually uninstall gsutil so I'm stuck.
Any ideas?
Thanks
Have you tried upgrading oauth2client?
pip install -U oauth2client