最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - ModuleNotFoundError: No module named 'trl' - Stack Overflow

programmeradmin0浏览0评论

I have installed trl using pip.

!pip show trl

and its showing packages info properly,

!pip show trl

Name: trl
Version: 0.7.10
Summary: Train transformer language models with reinforcement learning.
Home-page: 
Author: Leandro von Werra
Author-email: [email protected]
License: Apache 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: accelerate, datasets, numpy, torch, transformers, tyro
Required-by: 

However, when I am importing in Notebook its showing error:

import trl

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[9], line 1
----> 1 import trl

ModuleNotFoundError: No module named 'trl'

Why this discrepancy? How to resolve it?

I have installed trl using pip.

!pip show trl

and its showing packages info properly,

!pip show trl

Name: trl
Version: 0.7.10
Summary: Train transformer language models with reinforcement learning.
Home-page: https://github/huggingface/trl
Author: Leandro von Werra
Author-email: [email protected]
License: Apache 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: accelerate, datasets, numpy, torch, transformers, tyro
Required-by: 

However, when I am importing in Notebook its showing error:

import trl

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[9], line 1
----> 1 import trl

ModuleNotFoundError: No module named 'trl'

Why this discrepancy? How to resolve it?

Share Improve this question asked Nov 20, 2024 at 5:34 Sazzad Hissain KhanSazzad Hissain Khan 40.3k41 gold badges209 silver badges299 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The problem was solved when I installed from direct source using,

pip install git+https://github/huggingface/trl.git
发布评论

评论列表(0)

  1. 暂无评论