0

簡単インストールでモジュールをインストールしてみました。インストールされているようですが、インポートできません。

# easy_install uuid
Searching for uuid
Reading http://pypi.python.org/simple/uuid/
Reading http://zesty.ca/python/
Best match: uuid 1.30
Downloading http://pypi.python.org/packages/source/u/uuid/uuid-1.30.tar.gz#md5=639b310f1fe6800e4bf8aa1dd9333117
Processing uuid-1.30.tar.gz
Running uuid-1.30/setup.py -q bdist_egg --dist-dir /tmp/easy_install-mQlxdg/uuid-1.30/egg-dist-tmp-gLpk9N
zip_safe flag not set; analyzing archive contents...
Adding uuid 1.30 to easy-install.pth file

Installed /usr/lib/python2.6/site-packages/uuid-1.30-py2.6.egg
Processing dependencies for uuid
Finished processing dependencies for uuid


# python
>>> import uuid
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named uuid


# python -V
Python 2.4.3
4

2 に答える 2

3

モジュールがにインストールされているeasy_installことを明確に示していますが/usr/lib/python2.6、Python2.4を実行しています。

Python 2.6を明示的に実行するか(python2.6またはpython26)、またはを使用python -m easy_install uuidしてモジュールをデフォルトのPythonにインストールします。

于 2012-10-03T04:27:06.133 に答える
0

あなたが投稿したものを見ましたか:)?

Installed /usr/lib/python2.6/site-packages/uuid-1.30-py2.6.egg

# python -V
Python 2.4.3

Python 2.6を使用している場合(これは、今では古いので、2.4は古いので)、uuidモジュールはすでに存在しているはずなので、とにかくインストールする必要はありません。

于 2012-10-03T04:27:09.007 に答える