为什么python setup.py给了我';错误:选项--无法识别安装目录';错误?

为什么python setup.py给了我';错误:选项--无法识别安装目录';错误?,python,setup.py,Python,Setup.py,当我尝试将python项目安装到自定义本地python repo中时,我使用以下命令: python setup.py install --install-dir /home/peng/python-temp 其中setup.py是python项目Keras的简单setuptools脚本: 但此命令会触发以下错误: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --h

当我尝试将python项目安装到自定义本地python repo中时,我使用以下命令:

python setup.py install --install-dir /home/peng/python-temp
其中setup.py是python项目Keras的简单setuptools脚本:

但此命令会触发以下错误:

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --install-dir not recognized
为什么错误提示中的参数不存在?我应该用什么来有效地替代它

更新1

参数--install dir由setup.py触发的以下错误信息提示:

python setup.py install
running install

error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/test-easy-install-13269.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python3.6/dist-packages/
UPDATE2我尝试了'--prefix'选项,结果如下:

python setup.py install --prefix /home/peng/python-temp
running install
Checking .pth file support in /home/peng/python-temp/lib/python3.6/site-packages/
/opt/conda3/bin/python -E -c pass
TEST FAILED: /home/peng/python-temp/lib/python3.6/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:

    /home/peng/python-temp/lib/python3.6/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://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations


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

所以它们都不起作用。

setup.py中有什么?这是distutils还是setuptools?什么是自定义本地python repo?它是虚拟环境吗?python的自定义安装?也请编辑以包含导致第一个错误的命令。非常感谢您的反馈!已修改。您是否已阅读有关路径不在PYTHONPATH上的错误消息?这很容易解决。更好的是,您是否尝试过
--user
选项?