wenet icon indicating copy to clipboard operation
wenet copied to clipboard

pip install 遗漏了一些包

Open selaselah opened this issue 1 year ago • 7 comments

Describe the bug pip install 安装后丢失了一些包。 应该是这些包没有 init.py 导致的

To Reproduce import init_model 就能复现

  File "xxx.py", line 17, in init_model
    from wenet.utils.init_model import init_model
  File "xxx/lib/python3.10/site-packages/wenet/utils/init_model.py", line 18, in <module>
    from wenet.finetune.lora.utils import mark_only_lora_as_trainable
ModuleNotFoundError: No module named 'wenet.finetune'

Desktop (please complete the following information):

  • OS: Linux

selaselah avatar Jul 24 '24 03:07 selaselah

欢迎题pr

On Wed, Jul 24, 2024, 11:57 AM Chen @.***> wrote:

Describe the bug pip install 安装后丢失了一些包。 应该是这些包没有 init.py 导致的

To Reproduce import init_model 就能复现

File "xxx.py", line 17, in init_model from wenet.utils.init_model import init_model File "xxx/lib/python3.10/site-packages/wenet/utils/init_model.py", line 18, in from wenet.finetune.lora.utils import mark_only_lora_as_trainable ModuleNotFoundError: No module named 'wenet.finetune'

Desktop (please complete the following information):

  • OS: Linux

— Reply to this email directly, view it on GitHub https://github.com/wenet-e2e/wenet/issues/2581, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFN3Q4JQTS7L4WV3BTU7K3ZN4Q4PAVCNFSM6AAAAABLLUCPGOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQZDMNJUGE4DSOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Mddct avatar Jul 25 '24 01:07 Mddct

加init.py就能解决吗,我这边没遇到这个问题

fclearner avatar Jul 30 '24 01:07 fclearner

原因是在 setup.py

    packages=find_packages(),

这个 find_packages() 是通过检查 __init__.py 来定位包的,所以没有 __init__.py 就不会加入到 packages 里,安装时就会丢失。 有的人使用正常的原因,我猜测是通过类似 pip install -e . 的命令安装的。这时候整个文件夹会软链过去,所以不会出问题。


我不提pr的原因是丢失的文件太多的,我检查代码发现有的文件夹里有 py 文件,但是没有使用。并不知道这些文件的存在意图,所以还是维护者确认下比较好。

selaselah avatar Aug 01 '24 08:08 selaselah

了解了,后面补一个

fclearner avatar Aug 01 '24 08:08 fclearner

那请问这个问题怎么解决呀?

Ying9712 avatar Sep 01 '24 11:09 Ying9712

那请问这个问题怎么解决呀?

你还有碰到类似的问题吗,最新的代码我已经加了__init__.py了

fclearner avatar Sep 02 '24 05:09 fclearner

谢谢您的回复,问题解决啦。     ------------------ Original ------------------ From: @.>; Date:  Mon, Sep 2, 2024 01:54 PM To: @.>; Cc: @.>; @.>; Subject:  Re: [wenet-e2e/wenet] pip install 遗漏了一些包 (Issue #2581)

 

那请问这个问题怎么解决呀?

你还有碰到类似的问题吗,最新的代码我已经加了__init__.py了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Ying9712 avatar Sep 09 '24 09:09 Ying9712

最新的代码 应该是可以的

Mddct avatar Nov 08 '24 09:11 Mddct