English 中文(简体)
模块NotFoundError:没有称为变压器的模块
原标题:ModuleNotFoundError: no module named transformers

This is my first post and I am new to coding, so please let me know if you need more information. I have been running some AI to generate artwork and it has been working, but when I reloaded it the python script won t work and it is now saying "No module named transformers ". Can anyone help me out? It was when I upgraded to Google Colab Pro that I started to encounter issues although I am not sure why that would make a difference.

“enterography

最佳回答

或许是因为你没有在你(新,因为你已经升级为实验室)会议上安装图书馆变压器。 如欲将下列内容作为第一单元进行操作:!pip 安装变压器/代码>(......)教学开始必须进入“最终模式”。 这将把变压器包下载到会议环境中。

问题回答

Assuming you are referring to the module here https://pypi.org/project/transformers/ you need to install transformers with pip

pip install transformers

在这方面,一些可能的解决办法

1. Install the required package:

指挥员

!pip install transformers

或者,如果做不到工作,则尝试

!pip3 install transformers

请指出使用<代码>!,因为它是空壳的指挥,而不是假装。

2. Start over with a new run-time:

Click Runtime >Dislink andletprtime

然后点击Runtime >Run all

有时,你的编辑将召集口译。

预防性使用

!python -m pip install transformers

在你安装改造器后,确保进口改造器,并进口模块

如果已经安装的包裹在!pip显示变压器/代码>上显示,但你仍然不能使用Jupyter Lab/Notebook(Kel Colab)菜单(黄瓜)。

在安装<编码>transformerspip后,在谷歌科瓦尔邮袋(T4)中为我工作。

if it does not work with pip, try installing it with anaconda: conda install -c conda-forge transformers

你们需要检查你在什么环境中安装图书馆,以及你利用什么来管理这些囚室。 也许这是一个问题。

这并不是非常直观的,而且出于某种原因,该笔记本并没有在改变环境时自动改变为正确的环境。

即使你改变环境,在牢房中操作“!pip安装变压器”,在最初选定的环境中安装。

即便在我使用这一指令(pip安装变压器)之后,终端也说,

ModuleNotFoundError:无名为“变压器”的模块

但是,这在密码终端中解决了:

python -m pip install transformers




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签