1

この質問は些細なことかもしれませんが、正直なところ、私はPythonが初めてなのでわかりません。

私は Python 2.7.3 を実行しており、前述のパッケージはここにあります。

ラップトップに正しくインストールされていることを確認していただければ幸いです。参考までに、コマンド$ ./setup.py installおよび$ python2 setup.py installの出力をそれぞれ示します。

$ ./setup.py インストール

running install
running build
running build_py
creating build/lib
creating build/lib/guess_language
copying guess_language/__main__.py -> build/lib/guess_language
copying guess_language/__init__.py -> build/lib/guess_language
copying guess_language/console_mode.py -> build/lib/guess_language
creating build/lib/guess_language/data
copying guess_language/data/__init__.py -> build/lib/guess_language/data
creating build/lib/guess_language/data/models
copying guess_language/data/models/az.py -> build/lib/guess_language/data/models
copying guess_language/data/models/tl.py -> build/lib/guess_language/data/models
copying guess_language/data/models/pt.py -> build/lib/guess_language/data/models
copying guess_language/data/models/hu.py -> build/lib/guess_language/data/models
copying guess_language/data/models/so.py -> build/lib/guess_language/data/models
copying guess_language/data/models/pt_br.py -> build/lib/guess_language/data/models
copying guess_language/data/models/da.py -> build/lib/guess_language/data/models
copying guess_language/data/models/tn.py -> build/lib/guess_language/data/models
copying guess_language/data/models/fr.py -> build/lib/guess_language/data/models
copying guess_language/data/models/fi.py -> build/lib/guess_language/data/models
copying guess_language/data/models/__init__.py -> build/lib/guess_language/data/models
copying guess_language/data/models/is.py -> build/lib/guess_language/data/models
copying guess_language/data/models/id.py -> build/lib/guess_language/data/models
copying guess_language/data/models/bg.py -> build/lib/guess_language/data/models
copying guess_language/data/models/la.py -> build/lib/guess_language/data/models
copying guess_language/data/models/sl.py -> build/lib/guess_language/data/models
copying guess_language/data/models/pl.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ca.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ru.py -> build/lib/guess_language/data/models
copying guess_language/data/models/sk.py -> build/lib/guess_language/data/models
copying guess_language/data/models/lt.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ne.py -> build/lib/guess_language/data/models
copying guess_language/data/models/af.py -> build/lib/guess_language/data/models
copying guess_language/data/models/haw.py -> build/lib/guess_language/data/models
copying guess_language/data/models/sq.py -> build/lib/guess_language/data/models
copying guess_language/data/models/nl.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ceb.py -> build/lib/guess_language/data/models
copying guess_language/data/models/nso.py -> build/lib/guess_language/data/models
copying guess_language/data/models/en.py -> build/lib/guess_language/data/models
copying guess_language/data/models/uz.py -> build/lib/guess_language/data/models
copying guess_language/data/models/es.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ts.py -> build/lib/guess_language/data/models
copying guess_language/data/models/cs.py -> build/lib/guess_language/data/models
copying guess_language/data/models/sw.py -> build/lib/guess_language/data/models
copying guess_language/data/models/mn.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ro.py -> build/lib/guess_language/data/models
copying guess_language/data/models/hi.py -> build/lib/guess_language/data/models
copying guess_language/data/models/tlh.py -> build/lib/guess_language/data/models
copying guess_language/data/models/lv.py -> build/lib/guess_language/data/models
copying guess_language/data/models/zu.py -> build/lib/guess_language/data/models
copying guess_language/data/models/vi.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ar.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ss.py -> build/lib/guess_language/data/models
copying guess_language/data/models/pt_pt.py -> build/lib/guess_language/data/models
copying guess_language/data/models/it.py -> build/lib/guess_language/data/models
copying guess_language/data/models/de.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ky.py -> build/lib/guess_language/data/models
copying guess_language/data/models/sv.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ha.py -> build/lib/guess_language/data/models
copying guess_language/data/models/cy.py -> build/lib/guess_language/data/models
copying guess_language/data/models/xh.py -> build/lib/guess_language/data/models
copying guess_language/data/models/fa.py -> build/lib/guess_language/data/models
copying guess_language/data/models/kk.py -> build/lib/guess_language/data/models
copying guess_language/data/models/et.py -> build/lib/guess_language/data/models
copying guess_language/data/models/tr.py -> build/lib/guess_language/data/models
copying guess_language/data/models/st.py -> build/lib/guess_language/data/models
copying guess_language/data/models/sr.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ve.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ur.py -> build/lib/guess_language/data/models
copying guess_language/data/models/ps.py -> build/lib/guess_language/data/models
copying guess_language/data/models/nb.py -> build/lib/guess_language/data/models
copying guess_language/data/models/eu.py -> build/lib/guess_language/data/models
copying guess_language/data/models/nr.py -> build/lib/guess_language/data/models
copying guess_language/data/models/uk.py -> build/lib/guess_language/data/models
copying guess_language/data/models/mk.py -> build/lib/guess_language/data/models
copying guess_language/data/models/hr.py -> build/lib/guess_language/data/models
running install_lib
running install_egg_info
Removing /usr/local/lib/python3.2/dist-packages/guess_language_spirit-0.5a3.egg-info
error: /usr/local/lib/python3.2/dist-packages/guess_language_spirit-0.5a3.egg-info: Permission denied

$ python2 setup.py インストール

Traceback (most recent call last):
  File "setup.py", line 597, in <module>
    sys.exit(main())
  File "setup.py", line 592, in main
    run_setup_hooks(config)
  File "setup.py", line 569, in run_setup_hooks
    func(config)
  File "setup.py", line 582, in default_hook
    generate_py2k(config)
  File "setup.py", line 543, in generate_py2k
    run_3to2(copied_py_files)
  File "setup.py", line 374, in run_3to2
    raise OSError("3to2 script is unavailable.")
OSError: 3to2 script is unavailable.
4

2 に答える 2

2

setup.py installroot としてコマンドを実行する必要があります。

sudo python setup.py install

そうしないと、ファイルをディレクトリにコピーする権限がありません/usr/local/lib/python3.2/dist-packages

パッケージを Python 2 にインストールするには、最初に3to2パッケージをインストールする必要があります。

于 2012-11-25T14:34:37.437 に答える
1

最近では、pip (python パッケージ マネージャー) を使用してインストールできます。

  1. pip をインストールする必要があります - そして
  2. 単に:pip install guess_language
于 2015-08-30T06:36:59.643 に答える