我使用PIP在我的Mac Yosemite 10.10.5上安装了pycrypto . 我正在使用Python 2.7.10 .

当我尝试运行 from Crypto import Cipher 等代码时,会生成错误:

ImportError:无法导入名称密码

当我运行PIP SHOW PYCRYPTO时,我得到:

Metadata-Version: 2.0
Name: pycrypto
Version: 2.6.1
Summary: Cryptographic modules for Python.
Home-page: http://www.pycrypto.org/
Author: Dwayne C. Litzenberger
Author-email: dlitz@dlitz.net
License: UNKNOWN
Location: /Library/Python/2.7/site-packages
Requires:

我的SYS.PATH是:

['','/ Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg','/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27 . zip','/ System / Library / Framerame /Python.framework / Version / 1.7 / lib / python2.7','/ System / Library / Frameworks / Cluster.framework / Version / 2.7 / lib / python2.7 /plat- darwin','/ System / Library / Frame /Python.framework / Version / 7.7 / lib / python2.7 / plat-mac','/ System / Library / Frameworks /Python.framework / Version / 2.7 / lib / python2 . 7 / plat-mac / lib-scriptpackages','/ System / Library / Frameworks / Python.framework / Version / 7.7 / Extras / lib / python','/ System / Library / Frame /Python.framework / Version / 2.7 / lib / python2.7 / lib-tk','/ System / Library / Frame /Python.framework / Version / 7.7 / lib / python2.7 / lib-old','/ System / Library / Frameworks / Python.framework /版本/ 2.7 / lib / python2.7 / lib-dynload','/ User / Canonmacintyre / Library /Python / 2.7 / lib / python / site-packages','/ usr / local / lib / python2.7 / site- packages','/ System / Library / Frame /Python.framework / Version / 2.7 / Extras / lib / pytho n / PyObjC','/ Library /Python / 2.7 / site-package']

我似乎也有命令行工具,包括gcc,它们位于 /Library/Developer/CommandLineTools/usr/bin/ .