ERROR: file:///content does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found
H

1

8

https://colab.research.google.com/drive/11u6leEKvqE0CCbvDHHKmCxmW5GxyjlBm?usp=sharing

setup.py file is in transformers folder(root directory). But this error occurs when I run

!git clone https://github.com/huggingface/transformers
!cd transformers
!pip install -e .
!pip install -r transformers/examples/pytorch/translation/requirements.txt

Can anyone tell me why is this happening?

Hirohito answered 3/5, 2023 at 17:21 Comment(3)
I don't see that error anywhere on that page.Skiest
run the first 5 cells or just last 2 cellsHirohito
The problem appears to be the error in the PREVIOUS cell, that it couldn't clone the project because the directory already exists.Skiest
B
2

@TheHungryCub said right to you.
The cause is that you are not in transformers folder and that's why: "Python is unable to find a setup.py file or a pyproject.toml file" as was said before.

Command !cd transformers from your code doesn't change directory in Colab. You just simply have to use %cd transformers instead and delete transformers from !pip install -r transformers/examples/pytorch/translation/requirements.txt

The whole script will be:

!git clone https://github.com/huggingface/transformers
%cd transformers
!pip install -e .
!pip install -r examples/pytorch/translation/requirements.txt
Blasius answered 29/1 at 12:38 Comment(1)
%cd transformers did the trick.Dixson

© 2022 - 2024 — McMap. All rights reserved.