LINUX.ORG.RU
ФорумAdmin

PYTHONPATH


0

0

Здраствуйте. Есть хостинг, хочу на этом хостинге поставить Trac. Trac написан на Python. На хостинге я, естественно, не root. Но питон на хостинге есть. Скачал и пытаюсь поставить, на что питон говорит что

ImportError: No module named setuptools
Далее качаем setuptools и пытаемся установить
python ez_setup.py --install-dir=/home/username/bin
на что питон возражает

Downloading http://pypi.python.org/packages/2.3/s/setuptools/setuptools-0.6c9-py2.3.egg
TEST FAILED: /home1/scaberyc/bin 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:

    /home1/scaberyc/bin

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:

  http://peak.telecommunity.com/EasyInstall.html#custom-installation-locations

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

Ага. А теперь пишем

echo $PYTHONPATH
И видем что наша папка тоже добавлена в путях. Т.к. я ее сам прописал в .bashrc. Помогите мне, я в Линуксе новичок. Спасибо.

Перемещено Pi из Development

Сорри, разобрался. Надо было писать в .bashrc

export PYTHONPATH=...

а я всегда раньше писал просто

PYTHONPATH=...

А ведь в PATH работало и так...

facelift
() автор топика
Ответ на: комментарий от facelift

> А ведь в PATH работало и так...

Только до тех пор, пока PATH использовался только самим башем для поиска бинарей. Он-то неэкспортнутые переменные видит, а запущенным прогам не передаёт.

const86 ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.