ai-one / braindocsclient

The goal of the BraindocsClient is to provide a utility for BrainDocs users to interact with the BrainDocs API.
1 stars 1 forks source link

Error when installing on Windows 7 #1

Open kmanninen opened 9 years ago

kmanninen commented 9 years ago

Hi Tomi, I get an error when running the pip install on Windows 7. I'm trying to debug but I'm not having success thus far. I tried following some of the responses from this stackoverflow page to no avail:

http://stackoverflow.com/questions/1972259/cannot-open-include-file-config-win-h-no-such-file-or-directory-while-inst

Here is a copy of the command line output when I perform the install:

G:\TestCode\braindocsClient\braindocsClient [master]>  pip install git+https://github.com/ai-one/braindocsclient.git
?[33mYou are using pip version 6.0.8, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.?[0m
Collecting git+https://github.com/ai-one/braindocsclient.git
  Cloning https://github.com/ai-one/braindocsclient.git to c:\users\kurtwork\appdata\local\temp\pip-nd_epi1z-build
Requirement already satisfied (use --upgrade to upgrade): requests in c:\python34\lib\site-packages (from braindocsclient==1.0.1)
Collecting sqlalchemy (from braindocsclient==1.0.1)
  Using cached SQLAlchemy-1.0.8.tar.gz
Collecting python-dateutil (from braindocsclient==1.0.1)
  Using cached python_dateutil-2.4.2-py2.py3-none-any.whl
Collecting mysql-python (from braindocsclient==1.0.1)
  Using cached MySQL-python-1.2.5.zip
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in c:\python34\lib\site-packages (from python-dateutil->braindocsclient==1.0.1)
Installing collected packages: braindocsclient, mysql-python, python-dateutil, sqlalchemy
  Running setup.py install for braindocsclient
    Installing braindocs2database-script.py script to C:\Python34\Scripts
    Installing braindocs2database.exe script to C:\Python34\Scripts
    Installing braindocs2database.exe.manifest script to C:\Python34\Scripts
  Running setup.py install for mysql-python
    building '_mysql' extension
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5
"-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.
obj /Zl
    _mysql.c
    _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
    Complete output from command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\KurtWork\\AppData\\Local\\Temp\\pip-build-odfynp71\
\mysql-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Kurt
Work\AppData\Local\Temp\pip-36r7ri7l-record\install-record.txt --single-version-externally-managed --compile:
    running install

    running build

    running build_py

    creating build

    creating build\lib.win32-3.4

    copying _mysql_exceptions.py -> build\lib.win32-3.4

    creating build\lib.win32-3.4\MySQLdb

    copying MySQLdb\__init__.py -> build\lib.win32-3.4\MySQLdb

    copying MySQLdb\converters.py -> build\lib.win32-3.4\MySQLdb

    copying MySQLdb\connections.py -> build\lib.win32-3.4\MySQLdb

    copying MySQLdb\cursors.py -> build\lib.win32-3.4\MySQLdb

    copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb

    copying MySQLdb\times.py -> build\lib.win32-3.4\MySQLdb

    creating build\lib.win32-3.4\MySQLdb\constants

    copying MySQLdb\constants\__init__.py -> build\lib.win32-3.4\MySQLdb\constants

    copying MySQLdb\constants\CR.py -> build\lib.win32-3.4\MySQLdb\constants

    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.4\MySQLdb\constants

    copying MySQLdb\constants\ER.py -> build\lib.win32-3.4\MySQLdb\constants

    copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.4\MySQLdb\constants

    copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.4\MySQLdb\constants

    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.4\MySQLdb\constants

    running build_ext

    building '_mysql' extension

    creating build\temp.win32-3.4

    creating build\temp.win32-3.4\Release

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5
"-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.
obj /Zl

    _mysql.c

    _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

    ----------------------------------------
?[31m    Command "C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\KurtWork\\AppData\\Local\\Temp\\pip-build-odfynp71\\mysql-python\\
setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\KurtWork\AppData\Lo
cal\Temp\pip-36r7ri7l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\KurtWork\AppData\Local\Temp\
pip-build-odfynp71\mysql-python?[0m
G:\TestCode\braindocsClient\braindocsClient [master]>
tdiggelm commented 9 years ago

The problem seems to be that setup tools cannot compile the mysql extension for python because it does not find the library files. Is mysql installed on that windows machine? Is there a specific developer build of mysql that contains the needed libraries/headers? Another alternative would be to install a python-only implementation of mysql, which is slower than the native one.

Sent from my iPhone

On 14 Sep 2015, at 23:17, Kurt Manninen notifications@github.com wrote:

Hi Tomi, I get an error when running the pip install on Windows 7. I'm trying to debug but I'm not having success thus far. I tried following some of the responses from this stackoverflow page to no avail:

http://stackoverflow.com/questions/1972259/cannot-open-include-file-config-win-h-no-such-file-or-directory-while-inst

Here is a copy of the command line output when I perform the install:

G:\TestCode\braindocsClient\braindocsClient [master]> pip install git+https://github.com/ai-one/braindocsclient.git ?[33mYou are using pip version 6.0.8, however version 7.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command.?[0m Collecting git+https://github.com/ai-one/braindocsclient.git Cloning https://github.com/ai-one/braindocsclient.git to c:\users\kurtwork\appdata\local\temp\pip-nd_epi1z-build Requirement already satisfied (use --upgrade to upgrade): requests in c:\python34\lib\site-packages (from braindocsclient==1.0.1) Collecting sqlalchemy (from braindocsclient==1.0.1) Using cached SQLAlchemy-1.0.8.tar.gz Collecting python-dateutil (from braindocsclient==1.0.1) Using cached python_dateutil-2.4.2-py2.py3-none-any.whl Collecting mysql-python (from braindocsclient==1.0.1) Using cached MySQL-python-1.2.5.zip Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in c:\python34\lib\site-packages (from python-dateutil->braindocsclient==1.0.1) Installing collected packages: braindocsclient, mysql-python, python-dateutil, sqlalchemy Running setup.py install for braindocsclient Installing braindocs2database-script.py script to C:\Python34\Scripts Installing braindocs2database.exe script to C:\Python34\Scripts Installing braindocs2database.exe.manifest script to C:\Python34\Scripts Running setup.py install for mysql-python building '_mysql' extension C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -Dversion=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release_mysql. obj /Zl _mysql.c _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe' failed with exit status 2 Complete output from command C:\Python34\python.exe -c "import setuptools, tokenize;file='C:\Users\KurtWork\AppData\Local\Temp\pip-build-odfynp71\ \mysql-python\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\Kurt Work\AppData\Local\Temp\pip-36r7ri7l-record\install-record.txt --single-version-externally-managed --compile: running install

running build

running build_py

creating build

creating build\lib.win32-3.4

copying _mysql_exceptions.py -> build\lib.win32-3.4

creating build\lib.win32-3.4\MySQLdb

copying MySQLdb\__init__.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\converters.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\connections.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\cursors.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\times.py -> build\lib.win32-3.4\MySQLdb

creating build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\__init__.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\CR.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\ER.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.4\MySQLdb\constants

running build_ext

building '_mysql' extension

creating build\temp.win32-3.4

creating build\temp.win32-3.4\Release

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5

"-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release_mysql. obj /Zl

_mysql.c

_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

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

?[31m Command "C:\Python34\python.exe -c "import setuptools, tokenize;file='C:\Users\KurtWork\AppData\Local\Temp\pip-build-odfynp71\mysql-python\ setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\KurtWork\AppData\Lo cal\Temp\pip-36r7ri7l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\KurtWork\AppData\Local\Temp\ pip-build-odfynp71\mysql-python?[0m G:\TestCode\braindocsClient\braindocsClient [master]> — Reply to this email directly or view it on GitHub.

tdiggelm commented 9 years ago

PyMySQL is a pure python implementation for mysql. It can also be installed via the package manager. When this is used, the database url needs to be adapted like:

mysql+pymysql://username>:<password>@<host/[?]

See http://docs.sqlalchemy.org/en/rel_0_9/dialects/mysql.html#module-sqlalchemy.dialects.mysql.pymysql for reference.

Sent from my iPhone

On 14 Sep 2015, at 23:17, Kurt Manninen notifications@github.com wrote:

Hi Tomi, I get an error when running the pip install on Windows 7. I'm trying to debug but I'm not having success thus far. I tried following some of the responses from this stackoverflow page to no avail:

http://stackoverflow.com/questions/1972259/cannot-open-include-file-config-win-h-no-such-file-or-directory-while-inst

Here is a copy of the command line output when I perform the install:

G:\TestCode\braindocsClient\braindocsClient [master]> pip install git+https://github.com/ai-one/braindocsclient.git ?[33mYou are using pip version 6.0.8, however version 7.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command.?[0m Collecting git+https://github.com/ai-one/braindocsclient.git Cloning https://github.com/ai-one/braindocsclient.git to c:\users\kurtwork\appdata\local\temp\pip-nd_epi1z-build Requirement already satisfied (use --upgrade to upgrade): requests in c:\python34\lib\site-packages (from braindocsclient==1.0.1) Collecting sqlalchemy (from braindocsclient==1.0.1) Using cached SQLAlchemy-1.0.8.tar.gz Collecting python-dateutil (from braindocsclient==1.0.1) Using cached python_dateutil-2.4.2-py2.py3-none-any.whl Collecting mysql-python (from braindocsclient==1.0.1) Using cached MySQL-python-1.2.5.zip Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in c:\python34\lib\site-packages (from python-dateutil->braindocsclient==1.0.1) Installing collected packages: braindocsclient, mysql-python, python-dateutil, sqlalchemy Running setup.py install for braindocsclient Installing braindocs2database-script.py script to C:\Python34\Scripts Installing braindocs2database.exe script to C:\Python34\Scripts Installing braindocs2database.exe.manifest script to C:\Python34\Scripts Running setup.py install for mysql-python building '_mysql' extension C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -Dversion=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release_mysql. obj /Zl _mysql.c _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe' failed with exit status 2 Complete output from command C:\Python34\python.exe -c "import setuptools, tokenize;file='C:\Users\KurtWork\AppData\Local\Temp\pip-build-odfynp71\ \mysql-python\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\Kurt Work\AppData\Local\Temp\pip-36r7ri7l-record\install-record.txt --single-version-externally-managed --compile: running install

running build

running build_py

creating build

creating build\lib.win32-3.4

copying _mysql_exceptions.py -> build\lib.win32-3.4

creating build\lib.win32-3.4\MySQLdb

copying MySQLdb\__init__.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\converters.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\connections.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\cursors.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb

copying MySQLdb\times.py -> build\lib.win32-3.4\MySQLdb

creating build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\__init__.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\CR.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\ER.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.4\MySQLdb\constants

copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.4\MySQLdb\constants

running build_ext

building '_mysql' extension

creating build\temp.win32-3.4

creating build\temp.win32-3.4\Release

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5

"-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release_mysql. obj /Zl

_mysql.c

_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

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

?[31m Command "C:\Python34\python.exe -c "import setuptools, tokenize;file='C:\Users\KurtWork\AppData\Local\Temp\pip-build-odfynp71\mysql-python\ setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record C:\Users\KurtWork\AppData\Lo cal\Temp\pip-36r7ri7l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\KurtWork\AppData\Local\Temp\ pip-build-odfynp71\mysql-python?[0m G:\TestCode\braindocsClient\braindocsClient [master]> — Reply to this email directly or view it on GitHub.

tdiggelm commented 9 years ago

The following stack-overflow article also talks about the issue:

http://stackoverflow.com/questions/1972259/cannot-open-include-file-config-win-h-no-such-file-or-directory-while-inst

tdiggelm commented 9 years ago

Or: http://stackoverflow.com/questions/26866147/mysql-python-install-fatal-error