当前位置:   article > 正文

pip install -e. 时出现的错误_pip install -e .命令报错

pip install -e .命令报错

pip install -e. 时出现的错误

今天在给项目文件安装依赖时,使用pip install -e.来安装时,出现报错:

(cheetah_gym) mutong@mutong-System-Product-Name:~/RobotDoc/cheetah_gym$ pip install -e.
Obtaining file:///home/mutong/RobotDoc/cheetah_gym
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      error: Multiple top-level packages discovered in a flat-layout: ['docker', 'cheetah_gym'].
      
      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.
      
      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:
      
      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names
      
      To find more information, look for "package discovery" on setuptools docs.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33

原因是有多个高级包,docker、cheetch_gym,搜索解决办法时有提出

python setup.py install --exclude-packages=lib,script

  • 1
  • 2

但是报错

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 --exclude-packages not recognized

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

其他人解决方法

最终的方法是在setup.py文件中加入py_modules=[]这一项

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/47227
推荐阅读
相关标签
  

闽ICP备14008679号