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

bip install mysqlclient - Python.h: No such file or directory #7

Closed
AbdealiLoKo opened this issue May 7, 2021 · 1 comment
Closed

Comments

@AbdealiLoKo
Copy link

Hi, was trying to use boa to call some of my python scripts.
My python script connects to MySQL in some cases.

Got the following error when I try to install mysqlclient with bip:

$ ./node_modules/.bin/bip install mysqlclient
sh "/home/abdealijk/node_modules/@pipcook/boa/binding/v6/bin/python /home/abdealijk/node_modules/@pipcook/boa/binding/v6/bin/pip install mysqlclient"
Collecting mysqlclient
  Using cached https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (setup.py) ... error
  ERROR: Command errored out with exit status 1:
....
    Running setup.py install for mysqlclient ... error
    ERROR: Command errored out with exit status 1:
     command: /home/abdealijk/node_modules/@pipcook/boa/binding/v6/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zhzlp_0p/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zhzlp_0p/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 /tmp/pip-record-_xhxik_q/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-zhzlp_0p/mysqlclient/
    Complete output (44 lines):
    mysql_config --version
    ['5.7.30']
    mysql_config --libs
    ['-L/usr/lib/x86_64-linux-gnu', '-lmysqlclient', '-lpthread', '-lz', '-lm', '-lrt', '-latomic', '-lssl', '-lcrypto', '-ldl']
    mysql_config --cflags
    ['-I/usr/include/mysql']
    ext_options:
      library_dirs: ['/usr/lib/x86_64-linux-gnu']
      libraries: ['mysqlclient', 'pthread', 'm', 'rt', 'atomic', 'dl']
      extra_compile_args: ['-std=c99']
      extra_link_args: []
      include_dirs: ['/usr/include/mysql']
      extra_objects: []
      define_macros: [('version_info', "(2,0,3,'final',0)"), ('__version__', '2.0.3')]
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-3.7/MySQLdb
    creating build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    running build_ext
    building 'MySQLdb._mysql' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/MySQLdb
    gcc -pthread -B /boa/.miniconda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(2,0,3,'final',0) -D__version__=2.0.3 -I/usr/include/mysql -I/home/abdealijk/node_modules/@pipcook/boa/binding/v6/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o -std=c99
    MySQLdb/_mysql.c:46:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/abdealijk/frontend/node_modules/@pipcook/boa/binding/v6/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zhzlp_0p/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zhzlp_0p/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 /tmp/pip-record-_xhxik_q/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Works fine if I use pip directly:

$ pip install mysqlclient
Collecting mysqlclient
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.0.3
@yorkie
Copy link
Member

yorkie commented May 24, 2021

Hey, bip was deprecated by us, pip works fine :)

@yorkie yorkie closed this as completed May 24, 2021
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

2 participants