gpt4 book ai didi

python - 无法安装 Python 包

转载 作者:太空狗 更新时间:2023-10-29 17:46:59 24 4
gpt4 key购买 nike

我是 CentOS 的新手,我正在尝试在其上安装 M2Crypto Python 包。

我跑了:

sudo python setup.py install

看起来一切正常:(这是输出的结尾)

removing 'build/bdist.linux-i686/egg' (and everything under it)
Processing M2Crypto-0.20.2-py2.4-linux-i686.egg
Removing /usr/lib/python2.4/site-packages/M2Crypto-0.20.2-py2.4-linux-i686.egg
Copying M2Crypto-0.20.2-py2.4-linux-i686.egg to /usr/lib/python2.4/site-packages
M2Crypto 0.20.2 is already the active version in easy-install.pth

Installed /usr/lib/python2.4/site-packages/M2Crypto-0.20.2-py2.4-linux-i686.egg
Processing dependencies for M2Crypto==0.20.2

但是我无法导入 M2Crypto:

$ python
Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import M2Crypto
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "M2Crypto/__init__.py", line 22, in ?
import __m2crypto
ImportError: No module named __m2crypto
>>>

我做错了什么?

最佳答案

我跑了:

python setup.py tests

然后修复了它。它复制了一些文件,我认为这导致将库放在正确的位置。

running test
running egg_info
writing M2Crypto.egg-info/PKG-INFO
writing top-level names to M2Crypto.egg-info/top_level.txt
writing dependency_links to M2Crypto.egg-info/dependency_links.txt
reading manifest file 'M2Crypto.egg-info/SOURCES.txt'
writing manifest file 'M2Crypto.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-i686-2.4/M2Crypto/__m2crypto.so -> M2Crypto
test_BitSTring (tests.test_asn1.ASN1TestCase) ... ok
.
.
.

关于python - 无法安装 Python 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4773659/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com