如何解决"No module name Botan"(无模块名称Botan)问题? [英] How do I solve the issue "No module name Botan"

查看:135
本文介绍了如何解决"No module name Botan"(无模块名称Botan)问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows 8和python 3.6.1,已在cmd中完成以下命令:

I am using windows 8 and python 3.6.1 I've done the following command in my cmd:

pip安装cryptoshop

pip install cryptoshop

但是,当我运行以下python代码时:

However, when I run the following python code:

from cryptoshop import encryptfile
from cryptoshop import decryptfile

result1 = encryptfile(filename="test", passphrase="mypassphrase", algo="srp")
print(result1)

result2 = decryptfile(filename="test.cryptoshop", passphrase="mypassphrase")
print(result2)

我收到以下错误:

回溯(最近通话最近): 文件"C:/Users/Owner/Desktop/test.py",第1行,在 从cryptoshop导入cryptofile 文件"C:\ Users \ Owner \ AppData \ Local \ Programs \ Python \ Python36-32 \ lib \ site-packages \ cryptoshop__init __.py",在第26行 从cryptoshop.cryptoshop导入cryptofile 文件"C:\ Users \ Owner \ AppData \ Local \ Programs \ Python \ Python36-32 \ lib \ site-packages \ cryptoshop \ cryptoshop.py",第56行 从._cascade_engine导入encry_decry_cascade 文件"C:\ Users \ Owner \ AppData \ Local \ Programs \ Python \ Python36-32 \ lib \ site-packages \ cryptoshop_cascade_engine.py",位于第27行 从._nonce_engine导入generate_nonce_timestamp 文件"C:\ Users \ Owner \ AppData \ Local \ Programs \ Python \ Python36-32 \ lib \ site-packages \ cryptoshop_nonce_engine.py",第39行,在 进口植物 ModuleNotFoundError:没有名为"botan"的模块

Traceback (most recent call last): File "C:/Users/Owner/Desktop/test.py", line 1, in from cryptoshop import encryptfile File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop__init__.py", line 26, in from cryptoshop.cryptoshop import encryptfile File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop\cryptoshop.py", line 56, in from ._cascade_engine import encry_decry_cascade File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop_cascade_engine.py", line 27, in from ._nonce_engine import generate_nonce_timestamp File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop_nonce_engine.py", line 39, in import botan ModuleNotFoundError: No module named 'botan'

现在,我显然知道您必须将botan安装到python中才能使用它.但是,这是我遇到的一个问题.我已按照指示从此链接下载了Botan:

Now, I obviously know that you must install botan into python in order to use it. However, this is where I am running into an issue. I've downloaded Botan from this link as instructed:

https://github.com/randombit/botan

然后我按照以下说明尝试安装Botan:

And then I've followed these instructions in an attempt to install Botan:

./configure.py [--prefix=/some/directory]
make
make install

但是,当我在命令行中键入make时,我收到一条错误消息,提示没有这样的命令.然后,当我运行上面的Python代码时,仍然出现no module Botan错误.所以很明显我在做某事.如何将Botan正确安装到我的Python 3.6目录中,以便可以使用cryptoshop.

However, when I type make into the command line I get an error saying there is no such command. And then when I go to run my above Python code I still get the no module Botan error. So obviously I am doing something run. How can I properly install Botan into my Python 3.6 directories so that I can use cryptoshop.

我还尝试了pip安装Botan,因为这就是我安装了许多其他python库的方式,但是也没有成功.

I've also attempted to do pip install Botan, as that is how I've installed so many other python libraries but that has been unsuccessful as well.

推荐答案

make是linux命令

根据botan网站,您可以在Windows上使用nmake作为替代( http://wiki.c2.com/?UsingNmake ):

According to the botan website you can use nmake as a replacement on windows ( http://wiki.c2.com/?UsingNmake ) :

在Windows上

您需要安装Python副本,并同时拥有Python和 您在路径中选择的编译器.打开命令外壳(或SDK 外壳程序),然后运行:

You need to have a copy of Python installed, and have both Python and your chosen compiler in your path. Open a command shell (or the SDK shell), and run:

  $ python configure.py --cc=msvc (or --cc=gcc for MinGW) [--cpu=CPU] 
  $ nmake 
  $ botan-test.exe 
  $ nmake install

Botan支持nmake替换Jom,使您可以运行 多个并行的构建作业.

Botan supports the nmake replacement Jom which enables you to run multiple build jobs in parallel.

源: https://botan.randombit.net/manual/building.html

这篇关于如何解决"No module name Botan"(无模块名称Botan)问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆