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
Closed
YoungjaeKim opened this issue
Jan 12, 2016
· 11 comments
Comments
pip install pymssql in Windows 10 64bit with Python 3.5 64bit has error.
Any workaround to address this issue?
The error log is as beow.
Collecting pymssql
Using cached pymssql-2.1.1.tar.gz
Installing collected packages: pymssql
Running setup.py install for pymssql
Complete output from command C:Python35python.exe -c «import setuptools, tokenize;file=’C:UsersYoungjaeAppDataLocalTemppycharm-packaging0.tmppymssqlsetup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —record C:UsersYoungjaeAppDataLocalTemppip-uhyoaql7-recordinstall-record.txt —single-version-externally-managed —compile:
setup.py: platform.system() => ‘Windows’
setup.py: platform.architecture() => (’64bit’, ‘WindowsPE’)
running install
running build
running build_ext
building ‘_mssql’ extension
creating build
creating buildtemp.win-amd64-3.5
creating buildtemp.win-amd64-3.5Release
C:Program Files (x86)Microsoft Visual Studio 14.0VCBINamd64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:UsersYoungjaeAppDataLocalTemppycharm-packaging0.tmppymssqlfreetdsvs2010_64include -IC:Python35include -IC:Python35include «-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE» «-IC:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE» «-IC:Program Files (x86)Windows Kits10include10.0.10586.0ucrt» «-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum» «-IC:Program Files (x86)Windows Kits10include10.0.10586.0shared» «-IC:Program Files (x86)Windows Kits10include10.0.10586.0um» «-IC:Program Files (x86)Windows Kits10include10.0.10586.0winrt» /Tc_mssql.c /Fobuildtemp.win-amd64-3.5Release_mssql.obj -DMSDBLIB
_mssql.c
_mssql.c(314): fatal error C1083: Cannot open include file: ‘sqlfront.h’: No such file or directory
error: command ‘C:Program Files (x86)Microsoft Visual Studio 14.0VCBINamd64cl.exe’ failed with exit status 2
----------------------------------------
Command «C:Python35python.exe -c «import setuptools, tokenize;file=’C:UsersYoungjaeAppDataLocalTemppycharm-packaging0.tmppymssqlsetup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —record C:UsersYoungjaeAppDataLocalTemppip-uhyoaql7-recordinstall-record.txt —single-version-externally-managed —compile» failed with error code 1 in C:UsersYoungjaeAppDataLocalTemppycharm-packaging0.tmppymssql
Even I encountered the same
_mssql.c(314): fatal error C1083: Cannot open include file: ‘sqlfront.h’: No such file or directory
error: command ‘C:Program Files (x86)Microsoft Visual Studio 14.0VCBINamd64cl.exe’ failed with exit status 2
While trying to install pymssql for win7 64 bit system. Any help here is really appreciated .
@YoungjaeKim Does that issue got resolved for you
Consider reopening this issue, since it happens on ‘pip install pymssql’. Does seem like a user support issue.
On Mac
brew install freetds@0.91
brew link —force freetds@0.91
pip install pymssql
whizzalan, ftruter, and mfcochauxlaberge reacted with thumbs down emoji
_mssql.c:314:22: fatal error: sqlfront.h: No such file or directory
Also happens when i do ‘pip install pymssql’
I solved it by installing freetds-devel
CentOS 7.2.1511, python 2.7.5
Solution for Windows and Python 3.6
Python 3.6 32-bit
Download package freetds-v0.95.95-win-x86-vs2015.zip from https://github.com/ramiro/freetds/releases
Unpack freetds-v0.95.95-win-x86-vs2015.zip to c:usr.
Now you got c:usrfreetds-v0.95.95-win-x86-vs2015 folder.
Next run cmd.exe and do the following:
set INCLUDE=c:usrfreetds-v0.95.95-win-x86-vs2015include;%INCLUDE%
set LIB=c:usrfreetds-v0.95.95-win-x86-vs2015lib-nossl;c:usrfreetds-v0.95.95-win-x86-vs2015lib-nosslstatic;%LIB%
pip install pymssql
This works for me on Windows 10 x64, Python 3.6 32-bit and Visual Studio 2017
Python 3.6 64-bit (Not tested)
Download package freetds-v0.95.95-win-x86_64-vs2015.zip from https://github.com/ramiro/freetds/releases
Unpack freetds-v0.95.95-win-x86_64-vs2015.zip to c:usr.
Now you got c:usrfreetds-v0.95.95-win-x86_64-vs2015 folder.
Next run cmd.exe and do the following:
set INCLUDE=c:usrfreetds-v0.95.95-win-x86_64-vs2015include;%INCLUDE%
set LIB=c:usrfreetds-v0.95.95-win-x86_64-vs2015lib-nossl;c:usrfreetds-v0.95.95-win-x86_64-vs2015lib-nosslstatic;%LIB%
pip install pymssql
@rudolfovich Thanks ! It works perfectly on Windows with Python 3.6. Now there is no difference between our developed code and deployed Linux scripts.
Solution for Windows and Python 3.6
Python 3.6 32-bit
Download package freetds-v0.95.95-win-x86-vs2015.zip from https://github.com/ramiro/freetds/releases
Unpack freetds-v0.95.95-win-x86-vs2015.zip to c:usr.
Now you got c:usrfreetds-v0.95.95-win-x86-vs2015 folder.Next run cmd.exe and do the following:
set INCLUDE=c:usrfreetds-v0.95.95-win-x86-vs2015include;%INCLUDE% set LIB=c:usrfreetds-v0.95.95-win-x86-vs2015lib-nossl;c:usrfreetds-v0.95.95-win-x86-vs2015lib-nosslstatic;%LIB% pip install pymssqlThis works for me on Windows 10 x64, Python 3.6 32-bit and Visual Studio 2017
Python 3.6 64-bit (Not tested)
Download package freetds-v0.95.95-win-x86_64-vs2015.zip from https://github.com/ramiro/freetds/releases
Unpack freetds-v0.95.95-win-x86_64-vs2015.zip to c:usr.
Now you got c:usrfreetds-v0.95.95-win-x86_64-vs2015 folder.Next run cmd.exe and do the following:
set INCLUDE=c:usrfreetds-v0.95.95-win-x86_64-vs2015include;%INCLUDE% set LIB=c:usrfreetds-v0.95.95-win-x86_64-vs2015lib-nossl;c:usrfreetds-v0.95.95-win-x86_64-vs2015lib-nosslstatic;%LIB% pip install pymssql
the 64 bit worked as well. I used it to install ctds
For ubuntu install freetds-dev
For ubuntu install
freetds-dev
Thank you very much, it works for my case.
I have faced the issue while installing the pymssql in my virtual machine (Centos 7)
I had python installed version 2.7.6
Command used to install pymssql ,
pip intall pymssql
Error information;
[root@dpitstsvr013 magendran]# pip install pymssql
Downloading/unpacking pymssql
Downloading pymssql-2.1.1.tar.gz (2.4MB): 2.4MB downloaded
Running setup.py (path:/tmp/pip_build_root/pymssql/setup.py) egg_info for package pymssql
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('64bit', 'ELF')
setup.py: platform.linux_distribution() => ('CentOS Linux', '7.0.1406', 'Core')
setup.py: platform.libc_ver() => ('glibc', '2.2.5')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
Installed /tmp/pip_build_root/pymssql/setuptools_git-1.1-py2.7.egg
Installing collected packages: pymssql
Running setup.py install for pymssql
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('64bit', 'ELF')
setup.py: platform.linux_distribution() => ('CentOS Linux', '7.0.1406', 'Core')
setup.py: platform.libc_ver() => ('glibc', '2.2.5')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
building '_mssql' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB
_mssql.c:314:22: fatal error: sqlfront.h: No such file or directory
#include "sqlfront.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-t3ztti-record/install-record.txt --single-version-externally-managed --compile:
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('64bit', 'ELF')
setup.py: platform.linux_distribution() => ('CentOS Linux', '7.0.1406', 'Core')
setup.py: platform.libc_ver() => ('glibc', '2.2.5')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
running install
running build
running build_ext
building '_mssql' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB
_mssql.c:314:22: fatal error: sqlfront.h: No such file or directory
#include "sqlfront.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-t3ztti-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pymssql
Storing debug log for failure in /root/.pip/pip.log
[root@dpitstsvr013 magendran]#
Can you please provide some solution if you have or else it would be helpful if you could give other way to install pymssql in centos7
Содержание
- Error in installing pymssql 1.0.2 on Windows 2003 x64
- 2 Answers 2
- Cannot install mssql with current docker image #118
- Comments
- Error when connecting (Python 2.7 — Windows 10 Home 64-bit) #465
- Comments
- failed to build: Cannot open include file: ‘sqlfront.h’: No such file or directory #372
- Comments
- Can’t compile on OS X 10.8.4 #129
- Comments
- include «sqlfront.h»
Error in installing pymssql 1.0.2 on Windows 2003 x64
I am trying to install the latest version of pymssql (1.0.2) in my Windows 2003 x64. However, I am constantly getting this error:
Any ideas? Isn’t sqlfront.h included in the installation of visual studio 2k8 (or any visual studios)
2 Answers 2
I had the same problem with Visual Studio 2008, Windows 7 64 and Python 2.7 (32 bits).
These were the steps I followed to solved it:
- Install Visual Studio 2008 (32 bits).
- Install Visual Studio 6.
- Install Python 2.7 (32 bits)
- Download pymssql (the same package you downloaded)
- Try to compile the source code (the same you did when you got the error, you will get it again).
- At the same directory where setup.py is, you should find a file named mssqldbmodule.c, open it.
- Change the lines #include and #include To #include «sqlfront.h» and #include «sqldb.h» So the compiler will look for sqlfront.h and sqldb.h files locally.
- Copy the files sqlfront.h and sqldb.h from: C:Program Files (x86)Microsoft Visual StudioVC98Include (Visual Studio 6 installation) To you local directory (where setup.py is).
- Copy the file NTWDBLIB.LIB from C:Program Files (x86)Microsoft Visual StudioVC98Lib To your local directory.
- Run again setup.py install
This way you will compile the library using the deprecated NTWDBLIB which is the one used by pymssql.
Источник
Cannot install mssql with current docker image #118
I tried adding the mssql package in apache-airflow ( pip install apache-airflow[crypto,celery,postgres,hive,jdbc,mssql]==1.8.2 ) and got the following error:
Any way to fix this? I need to be able to use the MsSqlHook in my environment.
The text was updated successfully, but these errors were encountered:
By adding freedts-dev to the buildDeps I was able to fix it. Hope this can help someone else out there 🙂
@AliUz could you walk me through exactly what you did here. I’m trying to do the same and struggling mightly
@alexanderfournier I just added the freedts-dev package to the initial buildDeps list and I was able to install airflow with mssql
@AliUz Do I have to rebuild the container or is there a way to do that post mortem ha. Sorry this is the first time I’ve used docker so I’m still green. Have you also tried the new odbc connector for mac os yet (they just came out with an alternative . I can’t seem to get that working either lol)
@alexanderfournier you will need to rebuild the container.
I am trying this as well and also new to Docker. When I follow the «add freetds-dev to the buildDeps list» referenced above it got through (re)building the container.
However, when I actually hit http://localhost:8080/admin/, every DAG that uses MSSQL fails to load with a message like the following:
] libsybdb.so.5: cannot open shared object file: No such file or directory
It appears that something is missing in the install. I found other pages referencing needing to symlink the libsybdb.so.5 file but I’m not sure where, or if, that needs to be done.
Hey @joshuasheppard Heads up but Microsoft released an ODBC that works with mac now so you don’t need freetds.
Appreciate the feedback I got to the same point you did after some tweaking. stuck where you are.
damn.
@alexanderfournier — got past the error just now by adding freetds-bin before python3-pip in the Dockerfile.
In reference to the Microsoft ODBC [driver], have you found a way to use that in this Dockerfile? I’m able to connect from my Mac just fine (last I checked) but wasn’t able to in this Debian container (until a few minutes ago).
Thoughts on a PR with freetds-dev added to the buildDeps list and freetds-bin to the regular dependencies list? If it’s useful, I will make the PR (assuming no one beats me to it).
@joshuasheppard I’d be interested in that PR. Need to connect to mssql as well..
Источник
Error when connecting (Python 2.7 — Windows 10 Home 64-bit) #465
Traceback (most recent call last):
File «testmssql.py», line 9, in
conn = pymssql.connect(serverName, userName, passwordVar, ‘master’)
File «pymssql.pyx», line 635, in pymssql.connect (pymssql.c:10734)
File «_mssql.pyx», line 1902, in _mssql.connect (_mssql.c:21821)
File «_mssql.pyx», line 553, in _mssql.MSSQLConnection.init (_mssql.c:5917)
ValueError: too many values to unpack (expected 2)
Happens when I try with _mssql.connect as well.
Installed via pip install pymssql.
Also tried installing from here and running ./setup.py build I get an error (can’t find sqlfront.h, there’s an sqlfront.pxd in the src directory).
The text was updated successfully, but these errors were encountered:
Please provide a simple and self-contained test case that we could run locally (without any dependencies) that demonstrates the problem. Thanks.
server = ‘MyServer’
user = ‘MyUser’
password = ‘MyPassword’
conn = pymssql.connect(server, user, password, «master»)
conn.close()
@nobody37 I’m not sure what is going on with your install, but something is messed up.
I’ve tried the latest pymssql in both Python 2.7 and 3.5 on Ubuntu Linux. The following script works just fine for me:
It sounds to me like you may have an old or badly patched version of pymssql.
If you need additional assistance, please try the mailing list: https://groups.google.com/forum/#!forum/pymssql
This is a fresh install of Win 10 (64-bit). The only other software on this box besides Python is MSSQL 2016 Express and VS2015 Community.
Fresh install of Python 2.7.
Fresh install of Pymssql via pip. (Literally the first Python module I’ve installed on that box.)
Installing via Git as of yesterday does not seem to work trying to run setup.py build, complains about sqlfront.h not found (there’s an sqlfront.pxd there though).
I found a workaround to the issue since I only needed Detach/Attach DB functionality to just call SqlCmd from the cmdline and run that from Python. Would be nice to have this working for future projects.
Since it was installed by Pip, I don’t have FreeTDS already installed (or MingW). Could that be the issue?
I just ran the test script on a Windows 7 box, Python 2.7.8 32-bit, pip install -U for the latest version of pymssql, and had no issues.
Are you using 32 bit or 64 bit Python?
Building pymssql is complex on Windows, but the wheels we make available on pypi have FreeTDS built in, so you don’t need FreeTDS or MingW unless you want to build it yourself.
I also upgraded to 2.7.12 on 32 bit and installed 64 bit and tested on both. Still no errors.
I don’t see how a change to Windows 10 would give you an error message like you are getting above.
FWIW, have you tried using dictionary style arguments to pymssql.connect()?
The version of Python 64-bit I installed yesterday was from an MSI (python-2.7.12.amd64.msi) from the Python page.
I tried dictionary style arguments (pymssql.connect(server=’SERVERNAME’,user=’UserName’,password=’Password’)) and got the same result.
I also tried omitting user/pass to see if would try a trusted connection but still got that same error above (File «_mssql.pyx», line 553, in _mssql.MSSQLConnection.__init (_mssql.c:5917)
ValueError: too many values to unpack (expected 2))
Interestingly if I specify no parameters at all to connect it just hangs forever.
This is still not working. I’ve installed MingW so I can try and build pymssql. I want to get this up and running quickly so I can use pymssql to access a SQL Server backend from a Django web app.
Why is this not picking up «sqlfront.h»?
PS C:UsersrnernDownloadspymssql-masterpymssql-master> python setup.py build -c mingw32
setup.py: platform.system() => ‘Windows’
setup.py: platform.architecture() => (’64bit’, ‘WindowsPE’)
C:Python27libsite-packagessetuptoolsdist.py:285: UserWarning: Normalizing ‘2.2.0.dev’ to ‘2.2.0.dev0’
normalized_version,
running build
running build_ext
skipping ‘src_mssql.c’ Cython extension (up-to-date)
building ‘_mssql’ extension
creating build
creating buildtemp.win-amd64-2.7
creating buildtemp.win-amd64-2.7Release
creating buildtemp.win-amd64-2.7Releasesrc
C:MingWbingcc.exe -mdll -O -Wall -IC:UsersrnernDownloadspymssql-masterpymssql-masterfreetdsming_64include -IC
:Python27include -IC:Python27PC -c src_mssql.c -o buildtemp.win-amd64-2.7Releasesrc_mssql.o -DMSDBLIB -Wl,-allo
w-multiple-definition -Wl,-subsystem,windows-mthreads -mwindows -Wl,—strip-all -Wl,-allow-multiple-definition -Wl,-subs
ystem,windows-mthreads -mwindows -Wl,—strip-all
src_mssql.c:274:22: fatal error: sqlfront.h: No such file or directory
compilation terminated.
error: command ‘C:MingWbingcc.exe’ failed with exit status 1
I tried also deleting the existing _mssql.c and rebuilding and got the same result:
PS C:UsersrnernDownloadspymssql-masterpymssql-master> cd src
PS C:UsersrnernDownloadspymssql-masterpymssql-mastersrc> del ._mssql.c
PS C:UsersrnernDownloadspymssql-masterpymssql-mastersrc> cd ..
PS C:UsersrnernDownloadspymssql-masterpymssql-master> python setup.py build -c mingw32
setup.py: platform.system() => ‘Windows’
setup.py: platform.architecture() => (’64bit’, ‘WindowsPE’)
C:Python27libsite-packagessetuptoolsdist.py:285: UserWarning: Normalizing ‘2.2.0.dev’ to ‘2.2.0.dev0’
normalized_version,
running build
running build_ext
cythoning src_mssql.pyx to src_mssql.c
building ‘_mssql’ extension
C:MingWbingcc.exe -mdll -O -Wall -IC:UsersrnernDownloadspymssql-masterpymssql-masterfreetdsming_64include -IC
:Python27include -IC:Python27PC -c src_mssql.c -o buildtemp.win-amd64-2.7Releasesrc_mssql.o -DMSDBLIB -Wl,-allo
w-multiple-definition -Wl,-subsystem,windows-mthreads -mwindows -Wl,—strip-all -Wl,-allow-multiple-definition -Wl,-subs
ystem,windows-mthreads -mwindows -Wl,—strip-all
src_mssql.c:274:22: fatal error: sqlfront.h: No such file or directory
compilation terminated.
error: command ‘C:MingWbingcc.exe’ failed with exit status 1
PS C:UsersrnernDownloadspymssql-masterpymssql-master>
The only thing left that seems different between my tests and yours is that I’m using Windows 7 and you are using Windows 10. I just can’t see that the error you are getting could result from that difference. Since I can’t reproduce the error, I’m going to close this issue.
I think at this point it is best for you to take this troubleshooting to our forum:
Источник
failed to build: Cannot open include file: ‘sqlfront.h’: No such file or directory #372
pip install pymssql in Windows 10 64bit with Python 3.5 64bit has error.
Any workaround to address this issue?
The error log is as beow.
Collecting pymssql
Using cached pymssql-2.1.1.tar.gz
Installing collected packages: pymssql
Running setup.py install for pymssql
Complete output from command C:Python35python.exe -c «import setuptools, tokenize;file=’C:UsersYoungjaeAppDataLocalTemppycharm-packaging0.tmppymssqlsetup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —record C:UsersYoungjaeAppDataLocalTemppip-uhyoaql7-recordinstall-record.txt —single-version-externally-managed —compile:
setup.py: platform.system() => ‘Windows’
setup.py: platform.architecture() => (’64bit’, ‘WindowsPE’)
running install
running build
running build_ext
building ‘_mssql’ extension
creating build
creating buildtemp.win-amd64-3.5
creating buildtemp.win-amd64-3.5Release
C:Program Files (x86)Microsoft Visual Studio 14.0VCBINamd64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:UsersYoungjaeAppDataLocalTemppycharm-packaging0.tmppymssqlfreetdsvs2010_64include -IC:Python35include -IC:Python35include «-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE» «-IC:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE» «-IC:Program Files (x86)Windows Kits10include10.0.10586.0ucrt» «-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum» «-IC:Program Files (x86)Windows Kits10include10.0.10586.0shared» «-IC:Program Files (x86)Windows Kits10include10.0.10586.0um» «-IC:Program Files (x86)Windows Kits10include10.0.10586.0winrt» /Tc_mssql.c /Fobuildtemp.win-amd64-3.5Release_mssql.obj -DMSDBLIB
_mssql.c
_mssql.c(314): fatal error C1083: Cannot open include file: ‘sqlfront.h’: No such file or directory
error: command ‘C:Program Files (x86)Microsoft Visual Studio 14.0VCBINamd64cl.exe’ failed with exit status 2
Command «C:Python35python.exe -c «import setuptools, tokenize;file=’C:UsersYoungjaeAppDataLocalTemppycharm-packaging0.tmppymssqlsetup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —record C:UsersYoungjaeAppDataLocalTemppip-uhyoaql7-recordinstall-record.txt —single-version-externally-managed —compile» failed with error code 1 in C:UsersYoungjaeAppDataLocalTemppycharm-packaging0.tmppymssql
The text was updated successfully, but these errors were encountered:
Источник
Can’t compile on OS X 10.8.4 #129
From markaric. @gmail.com on September 01, 2013 16:05:54
I got latest (pymssql-2.0.0b1-dev-20130403).
Here’s the fatal error:
_mssql.c:257:10: fatal error: ‘sqlfront.h’ file not found
mark@macpro:pymssql-2.0.0b1-dev-20130403# python setup.py install
Compiling module Cython.Plex.Scanners .
Compiling module Cython.Plex.Actions .
Compiling module Cython.Compiler.Lexicon .
Compiling module Cython.Compiler.Scanning .
Compiling module Cython.Compiler.Parsing .
Compiling module Cython.Compiler.Visitor .
Compiling module Cython.Compiler.FlowControl .
Compiling module Cython.Compiler.Code .
Compiling module Cython.Runtime.refnanny .
warning: no files found matching ‘.pyx’ under directory ‘Cython/Debugger/Tests’
warning: no files found matching ‘.pxd’ under directory ‘Cython/Debugger/Tests’
warning: no files found matching ‘.h’ under directory ‘Cython/Debugger/Tests’
warning: no files found matching ‘.pxd’ under directory ‘Cython/Utility’
/var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/easy_install-M9_3dW/Cython-0.19.1/Cython/Compiler/Code.c:50081:19: warning: expression result unused [-Wunused-value]
PyObject_INIT(o, t);
^
/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7/objimpl.h:164:69: note: expanded from macro ‘PyObject_INIT’
( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
^
1 warning generated.
Installed /Users/mark/pymssql-2.0.0b1-dev-20130403/Cython-0.19.1-py2.7-macosx-10.8-x86_64.egg
creating var
creating var/folders
creating var/folders/hn
creating var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn
creating var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T
cc -arch x86_64 -c /var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c -o var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.o
/var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c:1:1: warning: type specifier missing, defaults to ‘int’ [-Wimplicit-int]
main (int argc, char **argv) <
^
/var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c:2:5: warning: implicit declaration of function ‘clock_gettime’ is invalid in C99
[-Wimplicit-function-declaration]
clock_gettime();
^
2 warnings generated.
cc -arch x86_64 var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.o -lrt -o a.out
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
running install
running bdist_egg
running egg_info
writing pymssql.egg-info/PKG-INFO
writing top-level names to pymssql.egg-info/top_level.txt
writing dependency_links to pymssql.egg-info/dependency_links.txt
reading manifest file ‘pymssql.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no files found matching ‘win32/freetds.zip’
writing manifest file ‘pymssql.egg-info/SOURCES.txt’
installing library code to build/bdist.macosx-10.8-x86_64/egg
running install_lib
running build_ext
skipping ‘_mssql.c’ Cython extension (up-to-date)
building ‘_mssql’ extension
creating build
creating build/temp.macosx-10.8-x86_64-2.7
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mssql.c -o build/temp.macosx-10.8-x86_64-2.7/_mssql.o -Wno-parentheses-equality -DMSDBLIB
_mssql.c:257:10: fatal error: ‘sqlfront.h’ file not found
include «sqlfront.h»
1 error generated.
error: command ‘cc’ failed with exit status 1
The text was updated successfully, but these errors were encountered:
Источник
(1). Оlxml
Официальное Bragging LXML говорит, что это самый полный и простой -использовать XML и HTML -анализатор в Python.
- Easy_install установка:
wget https://bootstrap.pypa.io/ez_setup.py -O - | python
Ссылаться на:https://pypi.python.org/pypi/setuptools
- Не рекомендуется использовать APT для установки PIP и простой, команда заключается в следующем:
sudo apt-get install python-setuptools python-pip
- Установка LXML (Ubuntu 15.04, выберите соответствующий LXML в соответствии с версией Python):
sudo apt-get install python2.7-lxml python3-lxml
Ссылаться на:http://lxml.de/installation.html
- После установки LXML вы можете легко установить егоpyqueryПодождите серию модулей анализа документов XML:
easy_install pyquery
- Ниже приведена трагическая история:
Если вы используете PIP или easy_install напрямую, может произойти ряд ошибок, например:
- src/lxml/lxml.etree.c:8:22: fatal error: pyconfig.h: No such file or directory
- Exception: Command «./configure —disable-dependency-tracking —disable-shar
- error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 4
Общее решение в SF Q & A — это:
sudo apt-get install libxml2 libxslt1.1 libxml2-dev libxslt1-dev python-libxml2 python-libxslt1 python-dev python-setuptools libxslt-dev zlib1g-dev
easy_install lxml || pip install lxml
Но после того, как я попробовал это, ни один из них не преуспел (возможно, система и среда были разными) …
Причиной сбоя является в основном следующий пакет зависимостейНе установлен, или обмен системного обмена недостаточно:
yum install libxslt-devel libxml2-devel libxsltl libxml python-dev
Но на самом деле, при установке LXML непосредственно с APT-GET обнаруживается, что это зависит только от:libxml2、libxslt1.1,
Кроме того, это официально рекомендуемый метод установки. Сущность Таким образом, поиск проблемы, поиск официального веб -сайта лучше, чем первый паром.
Ссылаться на:pip install lxml error、Installing lxml with pip…
(2) Установка PYMSSQL
Модуль PymsSQL Установка зависит отfreetdsЭто действительно поражение, и это также важная причина поддержки Python для поддержки SQLServer.
Процесс установки является как UPS и Downs, как LXML выше, в основном из -за Freetds. Ссылаясь на пост в блоге от великого Бога за границей:
Troubleshooting pymssql installation on UbuntuПроцесс заключается в следующем:
easy_install pymssql
Если вышеупомянутая команда выполнена успешно, вы можете пропустить следующее …
В противном случае, пожалуйста, сначала скачайте исходный код PYMSQL:
wget -q https://github.com/pymssql/pymssql/archive/master.zip
unzip -q master.zip
cd master
sudo python setup.py install
Если есть приглашение ошибок:Error: _mssql.c:8:22: fatal error: pyconfig.h: No such file or directory
sudo apt-get install python-dev
Если ошибка также сообщается:Error: _mssql.c:314:22: fatal error: sqlfront.h: No such file or directory
sudo apt-get install freetds-dev
Затем установите setup.py, чтобы быть в порядке!
Оказывается, что ключ к этому случаю заключается в том, установлен ли разработка пакета Python и Freetds.
Наконец, я могу выразить свое настроение только в оригинальных словах автора:
Installing pymssql on Ubuntu 13.10 was not an easy task.
Глубоко согласен. Как мой опыт.
(3).
Основным недостатком кросс-платформы Python по сравнению с кроссплатформенной Java является то, что многие модули PY зависят или связывают часть пакета C-LIB в некотором Linux.
НапримерPexpect и многое другое;
Хотя в Java есть много местной реализации, в основном перекрестная совместимость лучше.
3 things to evaluate to discover the best way for you to access web data.Register for the webinar
Start a new topic
Answered
Francisco Pires
started a topic
over 5 years ago
Hi,
I have deployed my project bue when it runs, give me this error:
File "/app/python/lib/python2.7/site-packages/scrapy/commands/crawl.py", line 57, in run self.crawler_process.crawl(spname, **opts.spargs) File "/app/python/lib/python2.7/site-packages/scrapy/crawler.py", line 168, in crawl return self._crawl(crawler, *args, **kwargs) File "/app/python/lib/python2.7/site-packages/scrapy/crawler.py", line 172, in _crawl d = crawler.crawl(*args, **kwargs) File "/app/python/lib/python2.7/site-packages/twisted/internet/defer.py", line 1532, in unwindGenerator return _inlineCallbacks(None, gen, Deferred()) --- <exception caught here> --- File "/app/python/lib/python2.7/site-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks result = g.send(result) File "/app/python/lib/python2.7/site-packages/scrapy/crawler.py", line 95, in crawl six.reraise(*exc_info) File "/app/python/lib/python2.7/site-packages/scrapy/crawler.py", line 77, in crawl self.engine = self._create_engine() File "/app/python/lib/python2.7/site-packages/scrapy/crawler.py", line 102, in _create_engine return ExecutionEngine(self, lambda _: self.stop()) File "/app/python/lib/python2.7/site-packages/scrapy/core/engine.py", line 70, in __init__ self.scraper = Scraper(crawler) File "/app/python/lib/python2.7/site-packages/scrapy/core/scraper.py", line 71, in __init__ self.itemproc = itemproc_cls.from_crawler(crawler) File "/app/python/lib/python2.7/site-packages/scrapy/middleware.py", line 58, in from_crawler return cls.from_settings(crawler.settings, crawler) File "/app/python/lib/python2.7/site-packages/scrapy/middleware.py", line 34, in from_settings mwcls = load_object(clspath) File "/app/python/lib/python2.7/site-packages/scrapy/utils/misc.py", line 44, in load_object mod = import_module(module) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/app/__main__.egg/Maiscarrinho/pipelines.py", line 9, in <module> exceptions.ImportError: No module named pymssql
I have python 2.1.3 installed and my spider works fine when i run the script manually with cmd.
I tried to put pymssql==2.1.3 in the requirement .txt but it throws this when i try to deploy:
Packing version 1.0
Deploying to Scrapy Cloud project "218288"
Deploy log last 30 lines:
Installing collected packages: pymssql
Running setup.py install for pymssql
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-o5IHzj/pymssql/setup.py';exec(compile(getatt
r(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-HC2agm-record/install-record.txt --sin
gle-version-externally-managed --compile --user --prefix=:
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('64bit', 'ELF')
setup.py: platform.linux_distribution() => ('Ubuntu', '12.04', 'precise')
setup.py: platform.libc_ver() => ('glibc', '2.4')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
running install
running build
running build_ext
building '_mssql' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.
c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB
_mssql.c:266:22: fatal error: sqlfront.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Someone can help me?
Thanks
Best Answer
vaz
said
over 5 years ago
1 Comment
vaz
said
over 5 years ago
I want install mdbtools from source
and I get the following error
fatal error: sql.h: No such file or directory
so I read the following solutions, but I don’t really understand them
https://forums.freebsd.org/threads/46299/
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=189382
I did the following:
$ sudo apt install libtool automake autoconf glib2.0 byacc unixodbc
$ cd ~/Downloads && git clone https://github.com/brianb/mdbtools
$ autoreconf -i -f
$ export DOCBOOK_DSL=/usr/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl
$ ./configure --with-unixodbc=/usr/local
$ make
$ make install
This is the full output from the make install command
Thanks for the help
--->> sudo make install
Making install in src
make[1]: Entering directory '/home/fabrizio/Downloads/mdbtools/src'
Making install in libmdb
make[2]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/libmdb'
make[3]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/libmdb'
/bin/mkdir -p '/usr/local/lib'
/bin/bash ../../libtool --mode=install /usr/bin/install -c libmdb.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libmdb.so.2.0.1 /usr/local/lib/libmdb.so.2.0.1
libtool: install: (cd /usr/local/lib && { ln -s -f libmdb.so.2.0.1 libmdb.so.2 || { rm -f libmdb.so.2 && ln -s libmdb.so.2.0.1 libmdb.so.2; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libmdb.so.2.0.1 libmdb.so || { rm -f libmdb.so && ln -s libmdb.so.2.0.1 libmdb.so; }; })
libtool: install: /usr/bin/install -c .libs/libmdb.lai /usr/local/lib/libmdb.la
libtool: install: /usr/bin/install -c .libs/libmdb.a /usr/local/lib/libmdb.a
libtool: install: chmod 644 /usr/local/lib/libmdb.a
libtool: install: ranlib /usr/local/lib/libmdb.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/libmdb'
make[2]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/libmdb'
Making install in extras
make[2]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/extras'
make[3]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/extras'
/bin/mkdir -p '/usr/local/bin'
/bin/bash ../../libtool --mode=install /usr/bin/install -c mdb-hexdump '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/mdb-hexdump /usr/local/bin/mdb-hexdump
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/extras'
make[2]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/extras'
Making install in sql
make[2]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/sql'
make install-am
make[3]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/sql'
make[4]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/sql'
/bin/mkdir -p '/usr/local/lib'
/bin/bash ../../libtool --mode=install /usr/bin/install -c libmdbsql.la '/usr/local/lib'
libtool: warning: relinking 'libmdbsql.la'
libtool: install: (cd /home/fabrizio/Downloads/mdbtools/src/sql; /bin/bash "/home/fabrizio/Downloads/mdbtools/libtool" --silent --tag CC --mode=relink gcc -I../../include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -g -O2 -DSQL -Wall -version-info 2:0:0 -export-symbols-regex "^mdb_sql_" -Wl,--as-needed -o libmdbsql.la -rpath /usr/local/lib mdbsql.lo parser.lo lexer.lo ../libmdb/libmdb.la -lglib-2.0 )
libtool: install: /usr/bin/install -c .libs/libmdbsql.so.2.0.0T /usr/local/lib/libmdbsql.so.2.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libmdbsql.so.2.0.0 libmdbsql.so.2 || { rm -f libmdbsql.so.2 && ln -s libmdbsql.so.2.0.0 libmdbsql.so.2; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libmdbsql.so.2.0.0 libmdbsql.so || { rm -f libmdbsql.so && ln -s libmdbsql.so.2.0.0 libmdbsql.so; }; })
libtool: install: /usr/bin/install -c .libs/libmdbsql.lai /usr/local/lib/libmdbsql.la
libtool: install: /usr/bin/install -c .libs/libmdbsql.a /usr/local/lib/libmdbsql.a
libtool: install: chmod 644 /usr/local/lib/libmdbsql.a
libtool: install: ranlib /usr/local/lib/libmdbsql.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/sql'
make[3]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/sql'
make[2]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/sql'
Making install in odbc
make[2]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/odbc'
CC odbc.lo
odbc.c:24:17: fatal error: sql.h: No such file or directory
compilation terminated.
Makefile:494: recipe for target 'odbc.lo' failed
make[2]: *** [odbc.lo] Error 1
make[2]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/odbc'
Makefile:375: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src'
Makefile:474: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
1. Problem installation BEDTOOLS Execute Make command is an error Fatal error: lzma.h: No Such file or directory
[email protected]:/home/software/bedtools2# ls LICENSE Makefile README.md bin data docs genomes obj scripts src test tutorial [email protected]-1N42TVH:/home/software/bedtools2# make
2, solution
[email protected]:/home/software/bedtools2# apt install libbz2-dev
[email protected]:/home/software/bedtools2# apt install zlib1g-dev
[email protected]:/home/software/bedtools2# apt install zlib1g-dev
3, execute make verification again, no fatal error: lzma.h: no such file or directory, but there is a new problem, no python
[email protected]:/home/software/bedtools2# make
4, install Python
View the system version
[email protected]:/home/software/bedtools2# cat /proc/version Linux version 5.10.16.3-microsoft-standard-WSL2 ([email protected]) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Apr 2 22:23:49 UTC 2021 [email protected]-1N42TVH:/home/software/bedtools2# cat /etc/issue Ubuntu 20.04.3 LTS n l
View python
[email protected]:/home/software/bedtools2# python Command 'python' not found, did you mean: command 'python3' from deb python3 command 'python' from deb python-is-python3 [email protected]-1N42TVH:/home/software/bedtools2# Python3 ## system default installation Python3 Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> quit()
5, establish a soft connection to solve
[email protected]:/home/software/bedtools2# which python3 /usr/bin/python3 [email protected]-1N42TVH:/home/software/bedtools2# ln -s /usr/bin/python3 /usr/bin/python [email protected]-1N42TVH:/home/software/bedtools2# python Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> quit()
6, again Make test, problem solving
[email protected]:/home/software/bedtools2# ls LICENSE Makefile README.md bin data docs genomes obj scripts src test tutorial [email protected]-1N42TVH:/home/software/bedtools2# make Building BEDTools: ========================================================= CXXFLAGS is [-g -Wall -O2 -std=c++11 ] DETECTED_VERSION = v2.30.0 CURRENT_VERSION = v2.30.0 - Building main bedtools binary. done. - Creating executables for old CLI. done. * compiling src/htsutil.cpp


