Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python2.7 install this module error #141

Open
Calebkonglei opened this issue Jun 26, 2018 · 4 comments
Open

python2.7 install this module error #141

Calebkonglei opened this issue Jun 26, 2018 · 4 comments

Comments

@Calebkonglei
Copy link

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/`

@Ludasheng
Copy link

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
Copy link

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

@k3v8ns
Copy link

k3v8ns commented Aug 8, 2018

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

@prashant0493
Copy link

prashant0493 commented May 20, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants