0

在对设置文件(在此处列出)应用建议的更改后,我在 Python 3.5 上成功安装了 Scrypt。但我无法弄清楚如何真正让它运行或通过它自己的测试。它抱怨“_scrypt”不存在,但根据 scrypt 目录,它确实存在。我的尝试:

C:\Users\cmcka\Desktop\mhallin-py-scrypt-119842611360>python setup.py build
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying scrypt.py -> build\lib.win-amd64-3.5
running build_ext
building '_scrypt' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\src
creating build\temp.win-amd64-3.5\Release\scrypt-1.1.6
creating build\temp.win-amd64-3.5\Release\scrypt-1.1.6\lib
creating build\temp.win-amd64-3.5\Release\scrypt-1.1.6\lib\crypto
creating build\temp.win-amd64-3.5\Release\scrypt-1.1.6\lib\scryptenc
creating build\temp.win-amd64-3.5\Release\scrypt-1.1.6\lib\util
creating build\temp.win-amd64-3.5\Release\scrypt-windows-stubs
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcsrc/scrypt.c /Fobuild\temp.win-amd64-3.5\Release\src/scrypt.obj
scrypt.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcscrypt-1.1.6/lib/crypto/crypto_aesctr.c /Fobuild\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/crypto/crypto_aesctr.obj
crypto_aesctr.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcscrypt-1.1.6/lib/crypto/crypto_scrypt-nosse.c /Fobuild\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/crypto/crypto_scrypt-nosse.obj
crypto_scrypt-nosse.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcscrypt-1.1.6/lib/crypto/sha256.c /Fobuild\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/crypto/sha256.obj
sha256.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcscrypt-1.1.6/lib/scryptenc/scryptenc.c /Fobuild\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/scryptenc/scryptenc.obj
scryptenc.c
scrypt-1.1.6/lib/scryptenc/scryptenc.c(111): warning C4244: '=': conversion from 'std::size_t' to 'double', possible loss of data
scrypt-1.1.6/lib/scryptenc/scryptenc.c(172): warning C4101: 'fd': unreferenced local variable
scrypt-1.1.6/lib/scryptenc/scryptenc.c(173): warning C4101: 'lenread': unreferenced local variable
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcscrypt-1.1.6/lib/scryptenc/scryptenc_cpuperf.c /Fobuild\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/scryptenc/scryptenc_cpuperf.obj
scryptenc_cpuperf.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcscrypt-1.1.6/lib/util/memlimit.c /Fobuild\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/util/memlimit.obj
memlimit.c
scrypt-1.1.6/lib/util/memlimit.c(331): warning C4244: '=': conversion from 'double' to 'std::size_t', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcscrypt-1.1.6/lib/util/warn.c /Fobuild\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/util/warn.obj
warn.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -Dinline=__inline -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win64\include -Iscrypt-windows-stubs/include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcscrypt-windows-stubs/gettimeofday.c /Fobuild\temp.win-amd64-3.5\Release\scrypt-windows-stubs/gettimeofday.obj
gettimeofday.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\OpenSSL-Win64\lib /LIBPATH:C:\Python35\libs /LIBPATH:C:\Python35\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64" libeay32.lib advapi32.lib /EXPORT:PyInit__scrypt build\temp.win-amd64-3.5\Release\src/scrypt.obj build\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/crypto/crypto_aesctr.obj build\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/crypto/crypto_scrypt-nosse.obj build\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/crypto/sha256.obj build\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/scryptenc/scryptenc.obj build\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/scryptenc/scryptenc_cpuperf.obj build\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/util/memlimit.obj build\temp.win-amd64-3.5\Release\scrypt-1.1.6/lib/util/warn.obj build\temp.win-amd64-3.5\Release\scrypt-windows-stubs/gettimeofday.obj /OUT:build\lib.win-amd64-3.5\_scrypt.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\src\_scrypt.cp35-win_amd64.lib
scrypt.obj : warning LNK4197: export 'PyInit__scrypt' specified multiple times; using first specification
   Creating library build\temp.win-amd64-3.5\Release\src\_scrypt.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\src\_scrypt.cp35-win_amd64.exp
Generating code
Finished generating code

C:\Users\cmcka\Desktop\mhallin-py-scrypt-119842611360>python setup.py install
running install
running bdist_egg
running egg_info
creating scrypt.egg-info
writing scrypt.egg-info\PKG-INFO
writing top-level names to scrypt.egg-info\top_level.txt
writing dependency_links to scrypt.egg-info\dependency_links.txt
writing manifest file 'scrypt.egg-info\SOURCES.txt'
reading manifest file 'scrypt.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'scrypt.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
copying build\lib.win-amd64-3.5\scrypt.py -> build\bdist.win-amd64\egg
copying build\lib.win-amd64-3.5\_scrypt.cp35-win_amd64.pyd -> build\bdist.win-amd64\egg
byte-compiling build\bdist.win-amd64\egg\scrypt.py to scrypt.cpython-35.pyc
creating stub loader for _scrypt.cp35-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\_scrypt.py to _scrypt.cpython-35.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying scrypt.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying scrypt.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying scrypt.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying scrypt.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
__pycache__._scrypt.cpython-35: module references __file__
creating dist
creating 'dist\scrypt-0.7.1-py3.5-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing scrypt-0.7.1-py3.5-win-amd64.egg
creating c:\python35\lib\site-packages\scrypt-0.7.1-py3.5-win-amd64.egg
Extracting scrypt-0.7.1-py3.5-win-amd64.egg to c:\python35\lib\site-packages
Adding scrypt 0.7.1 to easy-install.pth file

Installed c:\python35\lib\site-packages\scrypt-0.7.1-py3.5-win-amd64.egg
Processing dependencies for scrypt==0.7.1
Finished processing dependencies for scrypt==0.7.1

C:\Users\cmcka\Desktop\mhallin-py-scrypt-119842611360>python setup.py test
running test
running egg_info
writing dependency_links to scrypt.egg-info\dependency_links.txt
writing top-level names to scrypt.egg-info\top_level.txt
writing scrypt.egg-info\PKG-INFO
reading manifest file 'scrypt.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'scrypt.egg-info\SOURCES.txt'
running build_ext
copying build\lib.win-amd64-3.5\_scrypt.cp35-win_amd64.pyd ->
error: [WinError 126] The specified module could not be found

C:\Users\cmcka\Desktop\mhallin-py-scrypt-119842611360>python
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scrypt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\cmcka\Desktop\mhallin-py-scrypt-119842611360\scrypt.py", line 11, in <module>
    _scrypt = cdll.LoadLibrary(imp.find_module('_scrypt')[1])
  File "C:\Python35\lib\ctypes\__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "C:\Python35\lib\ctypes\__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
>>> ^DC:\Python35\Lib\site-packages\scrypt-0.7.1-py3.5-win-amd64.egg
^C
C:\Users\cmcka\Desktop\mhallin-py-scrypt-119842611360>cd C:\Python35\Lib\site-packages\scrypt-0.7.1-py3.5-win-amd64.egg

C:\Python35\Lib\site-packages\scrypt-0.7.1-py3.5-win-amd64.egg>dir
 Volume in drive C is Windows
 Volume Serial Number is CA5B-5BBB

 Directory of C:\Python35\Lib\site-packages\scrypt-0.7.1-py3.5-win-amd64.egg

08/11/2016  02:36 PM    <DIR>          .
08/11/2016  02:36 PM    <DIR>          ..
08/11/2016  02:36 PM    <DIR>          EGG-INFO
08/11/2016  02:36 PM             7,768 scrypt.py
08/11/2016  02:36 PM            31,232 _scrypt.cp35-win_amd64.pyd
08/11/2016  02:36 PM               306 _scrypt.py
08/11/2016  02:36 PM    <DIR>          __pycache__
               3 File(s)         39,306 bytes
               4 Dir(s)  120,141,914,112 bytes free

C:\Python35\Lib\site-packages\scrypt-0.7.1-py3.5-win-amd64.egg>

任何建议将不胜感激。编辑:无论在哪里运行“python”命令,都会发生错误。

4

1 回答 1

0

在使用 Process Monitor 跟踪 Scrypt 在我的工作台式机和非工作笔记本电脑上的活动后,我发现它需要 OpenSSL 的 libeay32.dll。一开始,我选择将它的 DLL 安装在 /bin 目录中,但不幸的是,Scrypt 没有检查那里。重新安装 OpenSSL 并选择将它们安装在 Windows 目录中后,它运行得很好。Scrypt 需要认真更新。

于 2016-08-13T00:31:12.153 回答