小编gee*_*rog的帖子

对象类型<class'str'>无法传递给C代码 - 虚拟环境

我正在使用mac anaconda.我尝试使用加密的AES.但是,我面临一个奇怪的问题.

我只是想执行一行简单的代码:

 obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
Run Code Online (Sandbox Code Playgroud)

如果我在没有虚拟环境的情况下运行代码,则可以.

$ python

Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more 
information.
>>> from Crypto.Cipher import AES

>>> obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
Run Code Online (Sandbox Code Playgroud)

如果我运行虚拟环境"testaes"然后我得到错误:

(testaes)$ python
Python 3.6.4 |Anaconda, Inc.| (default, Mar 12 2018, 20:05:31) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin …
Run Code Online (Sandbox Code Playgroud)

python anaconda

9
推荐指数
1
解决办法
1万
查看次数

标签 统计

anaconda ×1

python ×1