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

Failed building wheel for mysqlclient #74

Closed
epicserve opened this issue Feb 10, 2016 · 15 comments
Closed

Failed building wheel for mysqlclient #74

epicserve opened this issue Feb 10, 2016 · 15 comments

Comments

@epicserve
Copy link

I'm using Python 3.5.1 and pip 8.0.2 on OS X that I installed using pyenv. When installing mysqlclient I get the error "Failed building wheel for mysqlclient". The following is my terminal output.

$ pip install mysqlclient==1.3.7
Collecting mysqlclient==1.3.7
  Using cached mysqlclient-1.3.7.tar.gz
Building wheels for collected packages: mysqlclient
  Running setup.py bdist_wheel for mysqlclient ... error
  Complete output from command /Users/brento/.virtualenvs/pears-py3/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/q8/nr7dx6213ld0p451xxqm138h0000gp/T/pip-build-rayxd4we/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/q8/nr7dx6213ld0p451xxqm138h0000gp/T/tmpvg5zyj7upip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.11-x86_64-3.5
  copying _mysql_exceptions.py -> build/lib.macosx-10.11-x86_64-3.5
  creating build/lib.macosx-10.11-x86_64-3.5/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb
  copying MySQLdb/compat.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb
  copying MySQLdb/converters.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb
  copying MySQLdb/connections.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb
  copying MySQLdb/release.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb
  copying MySQLdb/times.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb
  creating build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants
  copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants
  running build_ext
  building '_mysql' extension
  creating build/temp.macosx-10.11-x86_64-3.5
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Dversion_info=(1,3,7,'final',1) -D__version__=1.3.7 -I/usr/local/Cellar/mysql/5.7.10/include/mysql -I/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c _mysql.c -o build/temp.macosx-10.11-x86_64-3.5/_mysql.o -fno-omit-frame-pointer
  clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk build/temp.macosx-10.11-x86_64-3.5/_mysql.o -L/usr/local/Cellar/mysql/5.7.10/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.11-x86_64-3.5/_mysql.cpython-35m-darwin.so
  installing to build/bdist.macosx-10.11-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.macosx-10.11-x86_64
  creating build/bdist.macosx-10.11-x86_64/wheel
  copying build/lib.macosx-10.11-x86_64-3.5/_mysql.cpython-35m-darwin.so -> build/bdist.macosx-10.11-x86_64/wheel
  copying build/lib.macosx-10.11-x86_64-3.5/_mysql_exceptions.py -> build/bdist.macosx-10.11-x86_64/wheel
  creating build/bdist.macosx-10.11-x86_64/wheel/MySQLdb
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/__init__.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/compat.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/connections.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb
  creating build/bdist.macosx-10.11-x86_64/wheel/MySQLdb/constants
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants/__init__.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb/constants
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants/CLIENT.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb/constants
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants/CR.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb/constants
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants/ER.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb/constants
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb/constants
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants/FLAG.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb/constants
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/constants/REFRESH.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb/constants
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/converters.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/cursors.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/release.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb
  copying build/lib.macosx-10.11-x86_64-3.5/MySQLdb/times.py -> build/bdist.macosx-10.11-x86_64/wheel/MySQLdb
  running install_egg_info
  running egg_info
  writing top-level names to mysqlclient.egg-info/top_level.txt
  writing dependency_links to mysqlclient.egg-info/dependency_links.txt
  writing mysqlclient.egg-info/PKG-INFO
  warning: manifest_maker: standard file '-c' not found

  reading manifest file 'mysqlclient.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'mysqlclient.egg-info/SOURCES.txt'
  Copying mysqlclient.egg-info to build/bdist.macosx-10.11-x86_64/wheel/mysqlclient-1.3.7-py3.5.egg-info
  running install_scripts
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/q8/nr7dx6213ld0p451xxqm138h0000gp/T/pip-build-rayxd4we/mysqlclient/setup.py", line 21, in <module>
      setuptools.setup(**metadata)
    File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/brento/.virtualenvs/pears-py3/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
      archive_basename = self.get_archive_basename()
    File "/Users/brento/.virtualenvs/pears-py3/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
      impl_tag, abi_tag, plat_tag = self.get_tag()
    File "/Users/brento/.virtualenvs/pears-py3/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
      assert tag == supported_tags[0]
  AssertionError

  ----------------------------------------
  Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
  Found existing installation: mysqlclient 1.3.6
    Uninstalling mysqlclient-1.3.6:
      Successfully uninstalled mysqlclient-1.3.6
  Running setup.py install for mysqlclient ... done
Successfully installed mysqlclient-1.3.7
@methane
Copy link
Member

methane commented Feb 11, 2016

pip install -U wheel will fix your problem.

@epicserve
Copy link
Author

Shouldn't this library be updated to work without having to use that extra flag?

@methane
Copy link
Member

methane commented Feb 11, 2016

What the extra frag means?
This is a compatibility problem between old wheel and Python 3.5.

https://bitbucket.org/pypa/wheel/issues/146/wheel-building-fails-on-cpython-350b3

@methane methane closed this as completed Feb 11, 2016
@luizs81
Copy link

luizs81 commented Dec 21, 2016

In case someone finds this page, what worked for me was reinstalling the XCode command line tools:

xcode-select --install

@methane
Copy link
Member

methane commented Dec 21, 2016 via email

@JayeshVaghasiya
Copy link

Download the pre-compiled whl file for mysql from from Christophe Gohlke’s Library of pre-compiled python packages for windows from the below location.

http://www.lfd.uci.edu/~gohlke/pythonlibs/#vlfd

Now got to directory where you downloaded that file and open command prompt there.

Now run below command

pip install xxx.whl

Best Luck !!

@arunkkumar2207j
Copy link

I was successfully in installing for python 3.7.2

pip install mysqlclient-1.4.1-cp37-cp37m-win32.whl

@dfrankow
Copy link

For me on OS X, this advice worked:

Step 1.

brew install openssl

Step 2.

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/

@justin-ad
Copy link

For me on OS X, this advice worked:

Step 1.

brew install openssl

Step 2.

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/

This worked for me too on MacOS, not sure why this is necessary though...

@Akashdesarda
Copy link

If you're using Anaconda (which I highly suggest you) then run these two commands

conda install -c anaconda mysql-connector-python

and

conda install -c bioconda mysqlclient

@Samiys
Copy link

Samiys commented Jun 14, 2019

For me on OS X, this advice worked:

Step 1.

brew install openssl

Step 2.

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/

Thanks! Worked for OS

@Dharmadas
Copy link

For me on OS X, this advice worked:
Step 1.
brew install openssl
Step 2.
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/

This worked for me too on MacOS, not sure why this is necessary though...

I followed above steps and now I am not able to pip install anything keep getting following error:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

@methane
Copy link
Member

methane commented Nov 28, 2019

@Dharmadas Your issue is not the issue of this project.
Please ask support on Python user community.

@timstallinger
Copy link

This is still an issue on Windows. None of the above answers worked for 64bit python

@methane
Copy link
Member

methane commented Sep 24, 2020

There are many MySQL and MySQL compatible libraries. And there are many ways to install them.
So you shouldn't expect just "pip install" can build wheel. You need to manage it by yourself.

If you can not fix your environment issue, ask help on Python community, not me.
OSS maintainer is not free tech suport. I can not support thousands of users.

@PyMySQL PyMySQL locked as off-topic and limited conversation to collaborators Sep 24, 2020
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