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

Can not install mysqlclient-python in python3 on mac #175

Closed
tingxin opened this issue Jun 5, 2017 · 4 comments
Closed

Can not install mysqlclient-python in python3 on mac #175

tingxin opened this issue Jun 5, 2017 · 4 comments

Comments

@tingxin
Copy link

tingxin commented Jun 5, 2017

Hi All,
I follow the readme.md file and follow those steps to install mysqlclient:

  1. create a new virtualenv
  2. use python3.5
  3. brew install mysql-connector-c
  4. sudo pip3 install mysqlclient or sudo pip install mysqlclient

i got the error like this:
`
Using cached mysqlclient-1.3.10.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/private/tmp/pip-build-th5nbtoa/mysqlclient/setup.py", line 17, in
metadata, options = get_config()
File "/private/tmp/pip-build-th5nbtoa/mysqlclient/setup_posix.py", line 54, in get_config
libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
File "/private/tmp/pip-build-th5nbtoa/mysqlclient/setup_posix.py", line 54, in
libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
File "/private/tmp/pip-build-th5nbtoa/mysqlclient/setup_posix.py", line 12, 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/tmp/pip-build-th5nbtoa/mysqlclient/
`

@methane
Copy link
Member

methane commented Jun 5, 2017

Why don't you search recent issues before filing new one?
#169
#170
#171

@methane methane closed this as completed Jun 5, 2017
@dariabiryukova
Copy link

I've got the same problem. What have been done it's just adding :/usr/local/mysql/bin the $PATH

@IrisYGL
Copy link

IrisYGL commented Oct 12, 2017

Hi,All
I had the following problems:

i) modify file: /usr/local/bin/mysql_config (which mysql_config)
origin:

Create options libs="-L$pkglibdir" libs="$libs -l "

modified to

Create options libs="-L$pkglibdir" libs="$libs -lmysqlclient -lssl -lcrypto"

ii)add environment veriables(brew info openssl)
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
iii)pip3 install mysqlclient

problem as below:

Collecting mysqlclient
Using cached mysqlclient-1.3.12.tar.gz
Building wheels for collected packages: mysqlclient
Running setup.py bdist_wheel for mysqlclient ... error
Complete output from command /Users/yuguanglin/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ml/xgv9v8gn6kl2l4yj3xmtyxnc0000gn/T/pip-build-z961_iww/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /var/folders/ml/xgv9v8gn6kl2l4yj3xmtyxnc0000gn/T/tmp8tr14eqmpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying mysql_exceptions.py -> build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/init.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
running build_ext
building 'mysql' extension
creating build/temp.macosx-10.9-x86_64-3.6
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/usr/local/opt/openssl/include -Dversion_info=(1,3,12,'final',0) -D__version
=1.3.12 -I/usr/local/Cellar/mysql-connector-c/6.1.11/include -I/Users/yuguanglin/anaconda3/include/python3.6m -c _mysql.c -o build/temp.macosx-10.9-x86_64-3.6/_mysql.o
/usr/bin/clang -bundle -undefined dynamic_lookup -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-rpath,/Users/yuguanglin/anaconda3/lib -L/Users/yuguanglin/anaconda3/lib -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-rpath,/Users/yuguanglin/anaconda3/lib -L/Users/yuguanglin/anaconda3/lib -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include -arch x86_64 build/temp.macosx-10.9-x86_64-3.6/_mysql.o -L/Users/yuguanglin/anaconda3/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.6/_mysql.cpython-36m-darwin.so $ libs
clang: error: no such file or directory: '$'
clang: error: no such file or directory: 'libs'
error: command '/usr/bin/clang' failed with exit status 1


Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command /Users/yuguanglin/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ml/xgv9v8gn6kl2l4yj3xmtyxnc0000gn/T/pip-build-z961_iww/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/ml/xgv9v8gn6kl2l4yj3xmtyxnc0000gn/T/pip-cgt6e4dt-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying mysql_exceptions.py -> build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/init.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
running build_ext
building 'mysql' extension
creating build/temp.macosx-10.9-x86_64-3.6
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/usr/local/opt/openssl/include -Dversion_info=(1,3,12,'final',0) -D__version
=1.3.12 -I/usr/local/Cellar/mysql-connector-c/6.1.11/include -I/Users/yuguanglin/anaconda3/include/python3.6m -c _mysql.c -o build/temp.macosx-10.9-x86_64-3.6/_mysql.o
/usr/bin/clang -bundle -undefined dynamic_lookup -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-rpath,/Users/yuguanglin/anaconda3/lib -L/Users/yuguanglin/anaconda3/lib -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-rpath,/Users/yuguanglin/anaconda3/lib -L/Users/yuguanglin/anaconda3/lib -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include -arch x86_64 build/temp.macosx-10.9-x86_64-3.6/_mysql.o -L/Users/yuguanglin/anaconda3/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.6/_mysql.cpython-36m-darwin.so $ libs
clang: error: no such file or directory: '$'
clang: error: no such file or directory: 'libs'
error: command '/usr/bin/clang' failed with exit status 1

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

Command "/Users/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ml/xgv9v8gn6kl2l4yj3xmtyxnc0000gn/T/pip-build-z961_iww/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/ml/xgv9v8gn6kl2l4yj3xmtyxnc0000gn/T/pip-cgt6e4dt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ml/xgv9v8gn6kl2l4yj3xmtyxnc0000gn/T/pip-build-z961_iww/mysqlclient/

@methane

@methane
Copy link
Member

methane commented Oct 12, 2017

I'm not user support. Go stackoverflow.

@PyMySQL PyMySQL locked and limited conversation to collaborators Oct 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants