首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装pysqlcipher3 windows

安装pysqlcipher3 windows
EN

Stack Overflow用户
提问于 2020-05-11 05:30:10
回答 1查看 1.3K关注 0票数 3

我需要在我的windows计算机上安装pysqlcipher,但是当我这样做的时候:

代码语言:javascript
复制
pip install pysqlcipher

我有:

代码语言:javascript
复制
 Collecting pysqlcipher3
  Using cached https://files.pythonhosted.org/packages/a4/06/1d56bdec3129eff6dd54323d249784ccd90ce03c8cae7870d45e434bae77/pysqlcipher3-1.0.3.tar.gz
Building wheels for collected packages: pysqlcipher3
  Building wheel for pysqlcipher3 (setup.py) ... done
  WARNING: Legacy build of wheel for 'pysqlcipher3' created no files.
  Command arguments: 'C:\Users\Elouan\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Elouan\\AppData\\Local\\Temp\\pip-install-827zddbs\\pysqlcipher3\\setup.py'"'"'; __file__='"'"'C:\\Users\\Elouan\\AppData\\Local\\Temp\\pip-install-827zddbs\\pysqlcipher3\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Elouan\AppData\Local\Temp\pip-wheel-jkj29o6_' --python-tag cp38
  Command output: [use --verbose to show]
  Running setup.py clean for pysqlcipher3
Failed to build pysqlcipher3
Installing collected packages: pysqlcipher3
  Running setup.py install for pysqlcipher3 ... done
Successfully installed pysqlcipher3
WARNING: You are using pip version 19.2.3, however version 20.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

我试着用git安装它,我有:

代码语言:javascript
复制
python setup.py build
running build
running build_py
running build_ext
Builds a C extension linking against libsqlcipher library
building 'pysqlcipher3._sqlite3' extension
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMODULE_NAME=\"pysqlcipher3.dbapi2\" -IC:\Users\Elouan\AppData\Local\Programs\Python\Python37\include -IC:\Users\Elouan\AppData\Local\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include" "-IF:\Windows Kits\10\include\10.0.18362.0\ucrt" "-IF:\Windows Kits\10\include\10.0.18362.0\shared" "-IF:\Windows Kits\10\include\10.0.18362.0\um" "-IF:\Windows Kits\10\include\10.0.18362.0\winrt" "-IF:\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc\python3\module.c /Fobuild\temp.win-amd64-3.7\Release\src\python3\module.obj
module.c
C:\Users\Elouan\pysqlcipher3\src\python3\connection.h(33): fatal error C1083: Impossible d'ouvrir le fichier include : 'sqlcipher/sqlite3.h' : No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

我在python3上试过了,但它是一样的。我认为这就像这个问题:Issue in installing pysqlcipher3,但我没有成功地解决这个问题

有人能帮帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2021-02-11 22:21:40

安装tlc (我正在使用8.6)

https://www.activestate.com/products/tcl/downloads/

路径中提供了(tclsh*.exe)。(tclsh C:\Tcl\bin\tclsh.exe)

安装VISUAL STUDIO (添加)和VISUAL STUDIO C++内部版本

转到microsoft

安装OpenSSL x64或x32 (我正在使用x64)

https://slproweb.com/products/Win32OpenSSL.html

添加到路径

x64

代码语言:javascript
复制
OPENSSL_CONF C:\Program Files\OpenSSL-Win64\bin\openssl.cfg

x32

代码语言:javascript
复制
OPENSSL_CONF C:\Program Files(x86)\OpenSSL-Win32\bin\openssl.cfg

在文件夹中

C:\Program Files\OpenSSL-Win64\lib

保存副本

libcrypto.deflibcrypto.lib

并重命名为

libeay32.deflibeay32.lib

保存副本

libssl.deflibssl.lib

并重命名为

ssleay32.defssleay32.lib

复制文件夹

C:\Program Files\OpenSSL-Win64\include\openssl

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include

下载sqlcipher

https://github.com/sqlcipher/sqlcipher

在根sqlcipher中更改Makefile.msc

代码语言:javascript
复制
TCC = $(TCC) -DSQLITE_TEMP_STORE=1

更改为

代码语言:javascript
复制
TCC = $(TCC) -DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC -I"C:\Program Files\OpenSSL-Win64\include"

下一步

代码语言:javascript
复制
# If ICU support is enabled, add the linker options for it.
#
!IF $(USE_ICU)!=0
LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
LTLIBS = $(LTLIBS) $(LIBICU)
!ENDIF
# <</mark>>
# You should not have to change anything below this line

更改为

代码语言:javascript
复制
# If ICU support is enabled, add the linker options for it.
#
!IF $(USE_ICU)!=0
LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
LTLIBS = $(LTLIBS) $(LIBICU)
!ENDIF
# <</mark>>

LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:"C:\Program Files\OpenSSL-Win64\lib\VC\static"
LTLIBS = $(LTLIBS) libcrypto64MT.lib libssl64MT.lib ws2_32.lib shell32.lib advapi32.lib gdi32.lib user32.lib crypt32.lib


# You should not have to change anything below this line

x64本机工具命令(VS)

代码语言:javascript
复制
path\to\sqlcipher>

nmake /f Makefile.msc clean
nmake /f Makefile.msc

下载pysqlcipher3

https://github.com/rigglemania/pysqlcipher3

创建文件夹

/pysqlcipher3中的/amalgamation

/sqlcipher复制两个文件

sqlite3.c sqlite3.h

转到/pysqlcipher3/amalgamation

下载sqlite-amalgamation

https://sqlite.org/download.html

我使用的是https://sqlite.org/2021/sqlite-amalgamation-3340100.zip

创建文件夹

/pysqlcipher3/src/python3/sqlcipher

sqlite-amalgamation-3340100.zip复制4个文件

shell.c sqlite3.c sqlite.h sqliteext.h

/pysqlcipher3/src/python3/sqlcipher

x64本机工具命令(VS)

代码语言:javascript
复制
path\to\pysqlcipher3>

setup.py clean  
enter code here
setup.py build_amalgamation

setup.py install  
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61718992

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档