我一直在尝试scrypt
在我的 Windows 64 位笔记本电脑上安装 Python 包,因为我想使用的另一个包需要它。同样的包也需要 Python 3.6,所以在我的电脑上我既有 Python 2.7 也有 3.6,并使用pip
和pip3
区分两者。一切pip install scrypt
安装正常,但使用时pip3 install scrypt
出现以下错误:
scrypt-1.2.0/lib/crypto\crypto_scrypt.h(33): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
我尝试通过像这样克隆存储库来解决这个问题:
$ hg clone http://bitbucket.org/mhallin/py-scrypt
$ cd py-scrypt
$ PATHTOPYTHON3 setup.py build
然后给出以下错误
scrypt-1.2.0/libcperciva/crypto/crypto_aes.c(6): fatal error C1083: Cannot open include file: 'openssl/aes.h': No such file or directory
然后我通过更改以下代码解决了这个错误setup.py
elif sys.platform.startswith('win32'):
define_macros = [('inline', '__inline')]
libraries = ['libeay32', 'advapi32']
extra_sources = ['scrypt-windows-stubs/gettimeofday.c']
if struct.calcsize('P') == 8:
library_dirs = ['c:\OpenSSL-Win64\lib']
includes = ['c:\OpenSSL-Win64\include', 'scrypt-windows stubs/include']
else:
library_dirs = ['c:\OpenSSL-Win32\lib']
includes = ['c:\OpenSSL-Win32\include', 'scrypt-windows-stubs/include']
简单地让库是 64 位的
library_dirs = ['c:\OpenSSL-Win64\lib']
includes = ['c:\OpenSSL-Win64\include', 'scrypt-windows
但这再次给出了一个错误:
LINK : fatal error LNK1181: cannot open input file 'libeay32.lib'
之后我放弃了,来到这里问该怎么办。如何scrypt
在 Windows 上使用 Python 3.6?