我解決了這個問題(在Windows上的MiniConda安裝)由:
- 暢達安裝OpenSSL的
- 複製< MiniConda目錄>個\ ENVS \ <環境> \圖書館\包括\ OpenSSL的到< MiniConda目錄> \ ENVS \ <環境> \包括\ OpenSSL的(或mklink吧)
這將在其他Python環境中可能工作了。
但是,我遇到了更多的問題(我不知道如何解決):
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
C:\Program Files\MiniConda3\envs\python2\Library\bin\swig.exe -python "-IC:\Program Files\MiniConda3\envs\python2\include" "-IC:\Program Files\MiniConda3\envs\python2\PC" -Ic:\pkg\include -include
all -modern -builtin -outdir build\lib.win-amd64-2.7\M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG\_bio.i(64) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_rand.i(23) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_evp.i(180) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_dh.i(36) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_rsa.i(43) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_dsa.i(31) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_ssl.i(241) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_ssl.i(242) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_x509.i(332) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_pkcs7.i(44) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_pkcs7.i(44) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_util.i(11) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_ec.i(111) : Warning 454: Setting a pointer/reference variable may leak memory.
SWIG\_engine.i(168) : Warning 454: Setting a pointer/reference variable may leak memory.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\pal\appdata\local\temp\pip-build-reeqlh\M2Crypto\setup.py", line 280, in <module>
'clean': Clean
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Program Files\MiniConda3\envs\python2\lib\site-packages\setuptools\command\install.py", line 53, in run
return _install.run(self)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\users\pal\appdata\local\temp\pip-build-reeqlh\M2Crypto\setup.py", line 148, in run
build_ext.build_ext.run(self)
File "C:\Program Files\MiniConda3\envs\python2\lib\site-packages\setuptools\command\build_ext.py", line 46, in run
_build_ext.run(self)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\command\build_ext.py", line 448, in build_extensions
self.build_extension(ext)
File "C:\Program Files\MiniConda3\envs\python2\lib\site-packages\setuptools\command\build_ext.py", line 182, in build_extension
_build_ext.build_extension(self,ext)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\command\build_ext.py", line 498, in build_extension
depends=ext.depends)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Program Files\MiniConda3\envs\python2\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
----------------------------------------
Command ""C:\Program Files\MiniConda3\envs\python2\python.exe" -u -c "import setuptools, tokenize;__file__='c:\\users\\pal\\appdata\\local\\temp\\pip-build-reeqlh\\M2Crypto\\setup.py';exec(compile(get
attr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\pal\appdata\local\temp\pip-opk8he-record\install-record.txt --single-version-external
ly-managed --compile" failed with error code 1 in c:\users\pal\appdata\local\temp\pip-build-reeqlh\M2Crypto\
非常感謝邁克,第二環節爲我工作。我已經嘗試了很多,從這裏來。很大的幫助,非常感謝。 – Ram