memsql / memsql-python

This repository holds some python libraries and plugins designed to be used with MemSQL.
MIT License
62 stars 33 forks source link

File not compatible with Python 3.5.4 #16

Closed mayureshj27 closed 5 years ago

mayureshj27 commented 5 years ago

Hi,

I am trying to build the code with Python 3 but it seems the files database.py conversion.py are not made compatible still. Python 3 has no import module _mysql. Do you have a work around?

anubhav0fnu commented 5 years ago

Hey, When I tried to run sudo pip install memsql, I got the following issue!

    building '_mysql' extension
    creating build/temp.linux-x86_64-3.6
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,6,'final',1) -D__version__=1.3.6 -I/usr/include/mysql -I/usr/include/python3.6m -c _mysql.c -o build/temp.linux-x86_64-3.6/_mysql.o
    _mysql.c:40:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-6huj398h/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-i2ynts7_/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-6huj398h/mysqlclient/

This is the latest version they have in here which I can get installed in a conda environment with python Python 3.5.6 :: Anaconda, Inc. and Python 3.7.3

pip install memsql==2.19.0

So, this will help you to get rid of the python3 issue!

carlsverre commented 5 years ago

@anubhav0fnu thanks for replying to this issue! It slipped through the cracks - an issue which will be addressed in the future.

@anubhav0fnu regarding the error fatal error: Python.h: No such file or directory you can fix that by ensuring that you have installed python-dev for the version of Python you are using.

For @mayureshj27's issue - please ensure that you have installed the mysqlclient python package version 1.3.13. I will be releasing a new version of this library soon with updated dependencies.