1

私はpythonチュートリアルを進めていますが、非常に基本的なものが欠けているようです。チュートリアルには次のものがあります。

>>> import site
>>> site.getusersitepackages()
'/home/user/.local/lib/python3.2/site-packages'

しかし、私は次のようになります:

$ python
Python 2.6.8 (unknown, Jun  9 2012, 11:30:32) 
[GCC 4.5.3] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>> site.getusersitepackages()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getusersitepackages'

上で述べたように、私は で実行Python 2.6.8していcygwinます。

これはインストールエラーですか?

4

1 に答える 1

2

docs によると、この機能/機能は python2.7 で追加されました - あなたはまだ python 2.6 を使用しています

于 2013-02-11T02:55:55.853 に答える