0

以下のエラーとして、Linux サーバーに tweepy をインストールする際に問題が発生しました。

[kapom@neptune tweepy-dir]$ sudo python setup.py install    
Traceback (most recent call last):
      File "setup.py", line 3, in <module>
        from setuptools import setup, find_packages
    ImportError: No module named setuptools

次に、パッケージ setuptools をインストールしようとしましたが、このような別のエラーが発生しました...

[kapom@neptune setuptools-0.9.8]$ sudo python setup.py install --prefix=/opt/setuptools
running install
Checking .pth file support in /opt/setuptools/lib/python2.7/site-packages/
/usr/bin/python -E -c pass
TEST FAILED: /opt/setuptools/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /opt/setuptools/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:

  https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again.

何が間違っていたのかわかりません。誰でも私を助けてください:(

注** tweepy をインストールする前に、以下のコマンドで Python のバージョンを 2.6 から 2.7 に更新しました。

./configure
make
sudo make install
sudo update-alternatives --install /usr/bin/python python2.7 /usr/bin/python2.7 10

前もって感謝します。

4

1 に答える 1