How do I install oursql using pip?












0















I have been attempting to install oursql using pip (7.1.0, I installed it using sudo easy_install pip as for my purposes the version provided by python-pip is too old) via running:



sudo pip install oursql


but this returns the error:



Collecting oursql
Using cached oursql-0.9.3.1.tar.bz2
Building wheels for collected packages: oursql
Running setup.py bdist_wheel for oursql
Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpAakYx7pip-wheel-:
running bdist_wheel
running build
running build_ext
skipping 'oursqlx/oursql.c' Cython extension (up-to-date)
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
building 'oursql' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/oursqlx
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for oursql
Failed to build oursql
Installing collected packages: oursql
Running setup.py install for oursql
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-z5NtR4-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
skipping 'oursqlx/oursql.c' Cython extension (up-to-date)
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
building 'oursql' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-z5NtR4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8AI16g/oursql


I have tried to follow this guide, but I hadn't the foggiest what I was meant to do with the MYSQL_CONFIG variable as I have no idea what it should be set to. I also attempted running: sudo easy_install oursql to install oursql but it too failed, giving:



/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: 
PEP440Warning: 'python-apt (0.9.3.11build1)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'PyECLib (1.0.5m)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'pygame (1.9.1release)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
Searching for oursql
Reading https://pypi.python.org/simple/oursql/
Reading http://launchpad.net/oursql
Best match: oursql 0.9.3.1
Downloading https://pypi.python.org/packages/source/o/oursql/oursql-0.9.3.1.zip#md5=ad599ea2d95fc695df7195e9801b45c2
Processing oursql-0.9.3.1.zip
Writing /tmp/easy_install-gejSuT/oursql-0.9.3.1/setup.cfg
Running oursql-0.9.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gejSuT/oursql-0.9.3.1/egg-dist-tmp-N9kmGB
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1









share|improve this question




















  • 3





    It looks like you're missing mysql.h which comes from the libmysqlclient-dev package.

    – Timo
    Aug 21 '15 at 11:08
















0















I have been attempting to install oursql using pip (7.1.0, I installed it using sudo easy_install pip as for my purposes the version provided by python-pip is too old) via running:



sudo pip install oursql


but this returns the error:



Collecting oursql
Using cached oursql-0.9.3.1.tar.bz2
Building wheels for collected packages: oursql
Running setup.py bdist_wheel for oursql
Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpAakYx7pip-wheel-:
running bdist_wheel
running build
running build_ext
skipping 'oursqlx/oursql.c' Cython extension (up-to-date)
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
building 'oursql' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/oursqlx
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for oursql
Failed to build oursql
Installing collected packages: oursql
Running setup.py install for oursql
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-z5NtR4-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
skipping 'oursqlx/oursql.c' Cython extension (up-to-date)
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
building 'oursql' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-z5NtR4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8AI16g/oursql


I have tried to follow this guide, but I hadn't the foggiest what I was meant to do with the MYSQL_CONFIG variable as I have no idea what it should be set to. I also attempted running: sudo easy_install oursql to install oursql but it too failed, giving:



/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: 
PEP440Warning: 'python-apt (0.9.3.11build1)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'PyECLib (1.0.5m)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'pygame (1.9.1release)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
Searching for oursql
Reading https://pypi.python.org/simple/oursql/
Reading http://launchpad.net/oursql
Best match: oursql 0.9.3.1
Downloading https://pypi.python.org/packages/source/o/oursql/oursql-0.9.3.1.zip#md5=ad599ea2d95fc695df7195e9801b45c2
Processing oursql-0.9.3.1.zip
Writing /tmp/easy_install-gejSuT/oursql-0.9.3.1/setup.cfg
Running oursql-0.9.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gejSuT/oursql-0.9.3.1/egg-dist-tmp-N9kmGB
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1









share|improve this question




















  • 3





    It looks like you're missing mysql.h which comes from the libmysqlclient-dev package.

    – Timo
    Aug 21 '15 at 11:08














0












0








0








I have been attempting to install oursql using pip (7.1.0, I installed it using sudo easy_install pip as for my purposes the version provided by python-pip is too old) via running:



sudo pip install oursql


but this returns the error:



Collecting oursql
Using cached oursql-0.9.3.1.tar.bz2
Building wheels for collected packages: oursql
Running setup.py bdist_wheel for oursql
Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpAakYx7pip-wheel-:
running bdist_wheel
running build
running build_ext
skipping 'oursqlx/oursql.c' Cython extension (up-to-date)
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
building 'oursql' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/oursqlx
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for oursql
Failed to build oursql
Installing collected packages: oursql
Running setup.py install for oursql
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-z5NtR4-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
skipping 'oursqlx/oursql.c' Cython extension (up-to-date)
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
building 'oursql' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-z5NtR4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8AI16g/oursql


I have tried to follow this guide, but I hadn't the foggiest what I was meant to do with the MYSQL_CONFIG variable as I have no idea what it should be set to. I also attempted running: sudo easy_install oursql to install oursql but it too failed, giving:



/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: 
PEP440Warning: 'python-apt (0.9.3.11build1)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'PyECLib (1.0.5m)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'pygame (1.9.1release)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
Searching for oursql
Reading https://pypi.python.org/simple/oursql/
Reading http://launchpad.net/oursql
Best match: oursql 0.9.3.1
Downloading https://pypi.python.org/packages/source/o/oursql/oursql-0.9.3.1.zip#md5=ad599ea2d95fc695df7195e9801b45c2
Processing oursql-0.9.3.1.zip
Writing /tmp/easy_install-gejSuT/oursql-0.9.3.1/setup.cfg
Running oursql-0.9.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gejSuT/oursql-0.9.3.1/egg-dist-tmp-N9kmGB
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1









share|improve this question
















I have been attempting to install oursql using pip (7.1.0, I installed it using sudo easy_install pip as for my purposes the version provided by python-pip is too old) via running:



sudo pip install oursql


but this returns the error:



Collecting oursql
Using cached oursql-0.9.3.1.tar.bz2
Building wheels for collected packages: oursql
Running setup.py bdist_wheel for oursql
Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpAakYx7pip-wheel-:
running bdist_wheel
running build
running build_ext
skipping 'oursqlx/oursql.c' Cython extension (up-to-date)
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
building 'oursql' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/oursqlx
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for oursql
Failed to build oursql
Installing collected packages: oursql
Running setup.py install for oursql
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-z5NtR4-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
skipping 'oursqlx/oursql.c' Cython extension (up-to-date)
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
building 'oursql' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c oursqlx/oursql.c -o build/temp.linux-x86_64-2.7/oursqlx/oursql.o
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AI16g/oursql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-z5NtR4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8AI16g/oursql


I have tried to follow this guide, but I hadn't the foggiest what I was meant to do with the MYSQL_CONFIG variable as I have no idea what it should be set to. I also attempted running: sudo easy_install oursql to install oursql but it too failed, giving:



/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: 
PEP440Warning: 'python-apt (0.9.3.11build1)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'PyECLib (1.0.5m)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'pygame (1.9.1release)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
Searching for oursql
Reading https://pypi.python.org/simple/oursql/
Reading http://launchpad.net/oursql
Best match: oursql 0.9.3.1
Downloading https://pypi.python.org/packages/source/o/oursql/oursql-0.9.3.1.zip#md5=ad599ea2d95fc695df7195e9801b45c2
Processing oursql-0.9.3.1.zip
Writing /tmp/easy_install-gejSuT/oursql-0.9.3.1/setup.cfg
Running oursql-0.9.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gejSuT/oursql-0.9.3.1/egg-dist-tmp-N9kmGB
warning: no usable mysql_config and no _winreg module to try; hopefully you have usable CFLAGS/LDFLAGS set.
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1






python mysql pip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 20 '15 at 20:47







BH2017

















asked Aug 20 '15 at 20:28









BH2017BH2017

3,6951860107




3,6951860107








  • 3





    It looks like you're missing mysql.h which comes from the libmysqlclient-dev package.

    – Timo
    Aug 21 '15 at 11:08














  • 3





    It looks like you're missing mysql.h which comes from the libmysqlclient-dev package.

    – Timo
    Aug 21 '15 at 11:08








3




3





It looks like you're missing mysql.h which comes from the libmysqlclient-dev package.

– Timo
Aug 21 '15 at 11:08





It looks like you're missing mysql.h which comes from the libmysqlclient-dev package.

– Timo
Aug 21 '15 at 11:08










3 Answers
3






active

oldest

votes


















2














I found the solution myself, the guide I was following led me to believe that pip would do all the work for me (i.e., install all the necessary dependencies) but I needed to install the MySQL Connector C++ libraries (Ubuntu package name: libmysqlcppconn-dev). So I ran sudo apt-get install libmysqlcppconn-dev to install this package and afterwards sudo pip install oursql ran without error. So Timo's comment was on the right track.






share|improve this answer































    0














    Install oursql in macOS.



    So, here's the standard solution to be able to install oursql correctly in macOS.



    brew install mysql@5.7


    Now, follow all the instructions given at the end of the installation.



    To run the secure installation(set password etc.), you'll need to go here and run /usr/local/mysql@5.7/bin/mysql_secure_installation



    Now, once we have mysql installed, there are some dependency of the ourselves package like mysql-client. You can install it with below command:



    brew install mysql-client


    After the installation follow the setup instructions given at the end of installation.



    Don't forget to reload bash here. source ~/.bash_profile



    Now, restart the mysql by brew service restart mysql



    Now, at last first install mysqlclient with pip and then install oursql.



    pip install mysqlclient
    pip install oursql


    All Good!






    share|improve this answer
























    • Are you aware this is AskUbuntu not AskmacOS (which doesn't exist, I know, making a point)? Hence I'm not asking how to do so on macOS, rather Ubuntu.

      – BH2017
      Oct 24 '18 at 8:14











    • Just like many users, I was redirected to this thread after many searches. So, I figured that this answer might help those in need. Otherwise Yes, I'm aware of this is AskUbuntu.

      – Jay Modi
      Oct 24 '18 at 9:00



















    0














    I just had a similar issue installing oursql in a virtualenv.



    My output included a similar error to this part below (from the question):



      oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
    #include "mysql.h"
    ^
    compilation terminated.


    Which led me to the solution in the accpeted answer of this stackoverflow question.



    sudo apt install libmysqlclient-dev fixed the issue in my case.






    share|improve this answer








    New contributor




    nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f663919%2fhow-do-i-install-oursql-using-pip%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      I found the solution myself, the guide I was following led me to believe that pip would do all the work for me (i.e., install all the necessary dependencies) but I needed to install the MySQL Connector C++ libraries (Ubuntu package name: libmysqlcppconn-dev). So I ran sudo apt-get install libmysqlcppconn-dev to install this package and afterwards sudo pip install oursql ran without error. So Timo's comment was on the right track.






      share|improve this answer




























        2














        I found the solution myself, the guide I was following led me to believe that pip would do all the work for me (i.e., install all the necessary dependencies) but I needed to install the MySQL Connector C++ libraries (Ubuntu package name: libmysqlcppconn-dev). So I ran sudo apt-get install libmysqlcppconn-dev to install this package and afterwards sudo pip install oursql ran without error. So Timo's comment was on the right track.






        share|improve this answer


























          2












          2








          2







          I found the solution myself, the guide I was following led me to believe that pip would do all the work for me (i.e., install all the necessary dependencies) but I needed to install the MySQL Connector C++ libraries (Ubuntu package name: libmysqlcppconn-dev). So I ran sudo apt-get install libmysqlcppconn-dev to install this package and afterwards sudo pip install oursql ran without error. So Timo's comment was on the right track.






          share|improve this answer













          I found the solution myself, the guide I was following led me to believe that pip would do all the work for me (i.e., install all the necessary dependencies) but I needed to install the MySQL Connector C++ libraries (Ubuntu package name: libmysqlcppconn-dev). So I ran sudo apt-get install libmysqlcppconn-dev to install this package and afterwards sudo pip install oursql ran without error. So Timo's comment was on the right track.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 21 '15 at 18:10









          BH2017BH2017

          3,6951860107




          3,6951860107

























              0














              Install oursql in macOS.



              So, here's the standard solution to be able to install oursql correctly in macOS.



              brew install mysql@5.7


              Now, follow all the instructions given at the end of the installation.



              To run the secure installation(set password etc.), you'll need to go here and run /usr/local/mysql@5.7/bin/mysql_secure_installation



              Now, once we have mysql installed, there are some dependency of the ourselves package like mysql-client. You can install it with below command:



              brew install mysql-client


              After the installation follow the setup instructions given at the end of installation.



              Don't forget to reload bash here. source ~/.bash_profile



              Now, restart the mysql by brew service restart mysql



              Now, at last first install mysqlclient with pip and then install oursql.



              pip install mysqlclient
              pip install oursql


              All Good!






              share|improve this answer
























              • Are you aware this is AskUbuntu not AskmacOS (which doesn't exist, I know, making a point)? Hence I'm not asking how to do so on macOS, rather Ubuntu.

                – BH2017
                Oct 24 '18 at 8:14











              • Just like many users, I was redirected to this thread after many searches. So, I figured that this answer might help those in need. Otherwise Yes, I'm aware of this is AskUbuntu.

                – Jay Modi
                Oct 24 '18 at 9:00
















              0














              Install oursql in macOS.



              So, here's the standard solution to be able to install oursql correctly in macOS.



              brew install mysql@5.7


              Now, follow all the instructions given at the end of the installation.



              To run the secure installation(set password etc.), you'll need to go here and run /usr/local/mysql@5.7/bin/mysql_secure_installation



              Now, once we have mysql installed, there are some dependency of the ourselves package like mysql-client. You can install it with below command:



              brew install mysql-client


              After the installation follow the setup instructions given at the end of installation.



              Don't forget to reload bash here. source ~/.bash_profile



              Now, restart the mysql by brew service restart mysql



              Now, at last first install mysqlclient with pip and then install oursql.



              pip install mysqlclient
              pip install oursql


              All Good!






              share|improve this answer
























              • Are you aware this is AskUbuntu not AskmacOS (which doesn't exist, I know, making a point)? Hence I'm not asking how to do so on macOS, rather Ubuntu.

                – BH2017
                Oct 24 '18 at 8:14











              • Just like many users, I was redirected to this thread after many searches. So, I figured that this answer might help those in need. Otherwise Yes, I'm aware of this is AskUbuntu.

                – Jay Modi
                Oct 24 '18 at 9:00














              0












              0








              0







              Install oursql in macOS.



              So, here's the standard solution to be able to install oursql correctly in macOS.



              brew install mysql@5.7


              Now, follow all the instructions given at the end of the installation.



              To run the secure installation(set password etc.), you'll need to go here and run /usr/local/mysql@5.7/bin/mysql_secure_installation



              Now, once we have mysql installed, there are some dependency of the ourselves package like mysql-client. You can install it with below command:



              brew install mysql-client


              After the installation follow the setup instructions given at the end of installation.



              Don't forget to reload bash here. source ~/.bash_profile



              Now, restart the mysql by brew service restart mysql



              Now, at last first install mysqlclient with pip and then install oursql.



              pip install mysqlclient
              pip install oursql


              All Good!






              share|improve this answer













              Install oursql in macOS.



              So, here's the standard solution to be able to install oursql correctly in macOS.



              brew install mysql@5.7


              Now, follow all the instructions given at the end of the installation.



              To run the secure installation(set password etc.), you'll need to go here and run /usr/local/mysql@5.7/bin/mysql_secure_installation



              Now, once we have mysql installed, there are some dependency of the ourselves package like mysql-client. You can install it with below command:



              brew install mysql-client


              After the installation follow the setup instructions given at the end of installation.



              Don't forget to reload bash here. source ~/.bash_profile



              Now, restart the mysql by brew service restart mysql



              Now, at last first install mysqlclient with pip and then install oursql.



              pip install mysqlclient
              pip install oursql


              All Good!







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Oct 24 '18 at 8:04









              Jay ModiJay Modi

              27124




              27124













              • Are you aware this is AskUbuntu not AskmacOS (which doesn't exist, I know, making a point)? Hence I'm not asking how to do so on macOS, rather Ubuntu.

                – BH2017
                Oct 24 '18 at 8:14











              • Just like many users, I was redirected to this thread after many searches. So, I figured that this answer might help those in need. Otherwise Yes, I'm aware of this is AskUbuntu.

                – Jay Modi
                Oct 24 '18 at 9:00



















              • Are you aware this is AskUbuntu not AskmacOS (which doesn't exist, I know, making a point)? Hence I'm not asking how to do so on macOS, rather Ubuntu.

                – BH2017
                Oct 24 '18 at 8:14











              • Just like many users, I was redirected to this thread after many searches. So, I figured that this answer might help those in need. Otherwise Yes, I'm aware of this is AskUbuntu.

                – Jay Modi
                Oct 24 '18 at 9:00

















              Are you aware this is AskUbuntu not AskmacOS (which doesn't exist, I know, making a point)? Hence I'm not asking how to do so on macOS, rather Ubuntu.

              – BH2017
              Oct 24 '18 at 8:14





              Are you aware this is AskUbuntu not AskmacOS (which doesn't exist, I know, making a point)? Hence I'm not asking how to do so on macOS, rather Ubuntu.

              – BH2017
              Oct 24 '18 at 8:14













              Just like many users, I was redirected to this thread after many searches. So, I figured that this answer might help those in need. Otherwise Yes, I'm aware of this is AskUbuntu.

              – Jay Modi
              Oct 24 '18 at 9:00





              Just like many users, I was redirected to this thread after many searches. So, I figured that this answer might help those in need. Otherwise Yes, I'm aware of this is AskUbuntu.

              – Jay Modi
              Oct 24 '18 at 9:00











              0














              I just had a similar issue installing oursql in a virtualenv.



              My output included a similar error to this part below (from the question):



                oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
              #include "mysql.h"
              ^
              compilation terminated.


              Which led me to the solution in the accpeted answer of this stackoverflow question.



              sudo apt install libmysqlclient-dev fixed the issue in my case.






              share|improve this answer








              New contributor




              nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                I just had a similar issue installing oursql in a virtualenv.



                My output included a similar error to this part below (from the question):



                  oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
                #include "mysql.h"
                ^
                compilation terminated.


                Which led me to the solution in the accpeted answer of this stackoverflow question.



                sudo apt install libmysqlclient-dev fixed the issue in my case.






                share|improve this answer








                New contributor




                nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  I just had a similar issue installing oursql in a virtualenv.



                  My output included a similar error to this part below (from the question):



                    oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
                  #include "mysql.h"
                  ^
                  compilation terminated.


                  Which led me to the solution in the accpeted answer of this stackoverflow question.



                  sudo apt install libmysqlclient-dev fixed the issue in my case.






                  share|improve this answer








                  New contributor




                  nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  I just had a similar issue installing oursql in a virtualenv.



                  My output included a similar error to this part below (from the question):



                    oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
                  #include "mysql.h"
                  ^
                  compilation terminated.


                  Which led me to the solution in the accpeted answer of this stackoverflow question.



                  sudo apt install libmysqlclient-dev fixed the issue in my case.







                  share|improve this answer








                  New contributor




                  nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 2 hours ago









                  nog642nog642

                  12




                  12




                  New contributor




                  nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  nog642 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f663919%2fhow-do-i-install-oursql-using-pip%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      GameSpot

                      connect to host localhost port 22: Connection refused

                      Getting a Wifi WPA2 wifi connection