Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the google collab #1955

Open
SergioK29 opened this issue Dec 10, 2024 · 6 comments
Open

fix the google collab #1955

SergioK29 opened this issue Dec 10, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@SergioK29
Copy link

requirements.txt is no longer ins /content/maigret its inside /content/maigret/docs, caused me a headache for 10 mins.

@SergioK29 SergioK29 added the bug Something isn't working label Dec 10, 2024
@SergioK29
Copy link
Author

infact the whole google collab is broken

Traceback (most recent call last):
File "/content/maigret/maigret/maigret.py", line 15, in
from socid_extractor import extract, parse
ModuleNotFoundError: No module named 'socid_extractor'

@SergioK29
Copy link
Author

and google cloud is broken also

Welcome to Cloud Shell! Type "help" to get started.
To set your Cloud Platform project in this session use “gcloud config set project [PROJECT_ID]”
cloudshell_open --repo_url "https://github.com/soxoj/maigret" --page "editor" --tutorial "README.md" --force_new_clone
idiot@cloudshell:~$ cloudshell_open --repo_url "https://github.com/soxoj/maigret" --page "editor" --tutorial "README.md" --force_new_clone
2024/12/10 19:15:52 Cloning https://github.com/soxoj/maigret into /home/idiot/cloudshell_open/maigret
Cloning into '/home/idiot/cloudshell_open/maigret'...
remote: Enumerating objects: 4719, done.
remote: Counting objects: 100% (1713/1713), done.
remote: Compressing objects: 100% (202/202), done.
remote: Total 4719 (delta 1637), reused 1511 (delta 1511), pack-reused 3006 (from 1)
Receiving objects: 100% (4719/4719), 8.03 MiB | 1.06 MiB/s, done.
Resolving deltas: 100% (3446/3446), done.
idiot@cloudshell:~/cloudshell_open/maigret$ maigret 
-bash: maigret: command not found
idiot@cloudshell:~/cloudshell_open/maigret$ ls
CHANGELOG.md        CONTRIBUTING.md  Dockerfile  example.ipynb  LICENSE  Makefile     opensuse.txt  pyinstaller     pytest.ini  sites.md        static  utils
CODE_OF_CONDUCT.md  cookies.txt      docs        Installer.bat  maigret  MANIFEST.in  poetry.lock   pyproject.toml  README.md   snapcraft.yaml  tests   wizard.py
idiot@cloudshell:~/cloudshell_open/maigret$ maigret --help
-bash: maigret: command not found
idiot@cloudshell:~/cloudshell_open/maigret$ python maigret 
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/idiot/cloudshell_open/maigret/maigret/__main__.py", line 9, in <module>
    from .maigret import main
ImportError: attempted relative import with no known parent package
idiot@cloudshell:~/cloudshell_open/maigret$ maigret --helpmaigret user --html
-bash: maigret: command not found
idiot@cloudshell:~/cloudshell_open/maigret$ maigret user --html
-bash: maigret: command not found
idiot@cloudshell:~/cloudshell_open/maigret$ maigret user --html
-bash: maigret: command not found
idiot@cloudshell:~/cloudshell_open/maigret$ maigret user --html
-bash: maigret: command not found
idiot@cloudshell:~/cloudshell_open/maigret$ cd maigret
idiot@cloudshell:~/cloudshell_open/maigret/maigret$ ls
activation.py  errors.py     __init__.py  __main__.py  permutator.py  report.py  result.py    sites.py   types.py  __version__.py
checking.py    executors.py  maigret.py   notify.py    __pycache__    resources  settings.py  submit.py  utils.py
idiot@cloudshell:~/cloudshell_open/maigret/maigret$ maigret.py
-bash: maigret.py: command not found
idiot@cloudshell:~/cloudshell_open/maigret/maigret$ python maigret.py 
Traceback (most recent call last):
  File "/home/idiot/cloudshell_open/maigret/maigret/maigret.py", line 15, in <module>
    from socid_extractor import extract, parse
ModuleNotFoundError: No module named 'socid_extractor'
idiot@cloudshell:~/cloudshell_open/maigret/maigret$ ```

@soxoj
Copy link
Owner

soxoj commented Dec 11, 2024

Hi, thanks! Maigret was migrated to poetry, so you don't have requirements.txt in the dir. Will the pip install . solve the problem? I'll check by myself it later.

@SkRagibIshrakAbid
Copy link

You can just do this:

clone and install manually

!git clone https://github.com/soxoj/maigret

%cd maigret

build and install

!pip3 install .

usage

!maigret Username

@davidwguo
Copy link

You can just do this:

clone and install manually

!git clone https://github.com/soxoj/maigret

%cd maigret

build and install

!pip3 install .

usage

!maigret Username

I encountered the same problem in Colab, and this solution works.
I also tried Google Cloud Shell and Binder, where similar situations exist. (However, I am not sure if this solution applies there.)

@soxoj
Copy link
Owner

soxoj commented Dec 12, 2024

I fixed the collab notebook, please, check: maigret.ipynb

@SergioK29 I cannot reproduce a problem with Google Cloud. Could you, please, try again from another account?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants