MySQLdb1 icon indicating copy to clipboard operation
MySQLdb1 copied to clipboard

python2.7 install this module error

Open Calebkonglei opened this issue 7 years ago • 4 comments

hello, when I use pip install this module, the terminal show this error message, my system is mac and the version of python is 2.7. what can i do to resolve it? thanks for your answer. the error message at bottom. ` Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/bf/rf_c_9f57b30tn47dv70hxlm0000gn/T/pip-install-dv3Rky/MySQL-python/setup.py", line 17, in metadata, options = get_config() File "setup_posix.py", line 53, in get_config libraries = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("l")) ] File "setup_posix.py", line 8, in dequote if s[0] in ""'" and s[0] == s[-1]: IndexError: string index out of range

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bf/rf_c_9f57b30tn47dv70hxlm0000gn/T/pip-install-dv3Rky/MySQL-python/`

Calebkonglei avatar Jun 26 '18 02:06 Calebkonglei

Uninstall MySQL, download and install the package through https://dev.mysql.com/downloads/mysql/, fool installation; Then download MySQL-python-1.2.5.zip, unzip it and open the setup_posix.py file, find mysql_config.path = "/usr/mysql_config", and change to the mysql_config path in your system; Finally, the python setup.py install is installed by source code, and the pro test is successful. Good luck!

Ludasheng avatar Jul 10 '18 05:07 Ludasheng

MySQL-python-1.2.5 jlb$ python setup.py install running install running bdist_egg running egg_info writing MySQL_python.egg-info/PKG-INFO writing top-level names to MySQL_python.egg-info/top_level.txt writing dependency_links to MySQL_python.egg-info/dependency_links.txt reading manifest file 'MySQL_python.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'MySQL_python.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.13-intel/egg running install_lib running build_py ... Copying MySQL_python-1.2.5-py2.7-macosx-10.13-intel.egg to /Users/jlb/Desktop/my_venvs/wx_venv/lib/python2.7/site-packages

Ludasheng avatar Jul 10 '18 05:07 Ludasheng

if only debug python code on remote , why need install mysql on local??

k3v8ns avatar Aug 08 '18 13:08 k3v8ns

Observed similar errors with pip installation on my OSX environment. Source installation was easier. Steps for source installation -

  1. Edit mysql_config path mentioned in MySQL-python-1.2.5/site.cfg with correct path on your local environment. For example, mysql_config = /usr/local/mysql/bin/mysql_config
  2. Run below commands inside directory MySQL-python-1.2.5 $ python setup.py build $ sudo python setup.py install

prashant0493 avatar May 20 '19 07:05 prashant0493