Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

No module named 'chardet' #622

Open
tom-doerr opened this issue May 25, 2022 · 2 comments
Open

No module named 'chardet' #622

tom-doerr opened this issue May 25, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@tom-doerr
Copy link

tom-doerr commented May 25, 2022

🐛 Bug Report

I followed the installation instruction but get

ModuleNotFoundError: No module named 'chardet'

when I try to run

poetry run <project_name> --help

Full stack trace:

Traceback (most recent call last):
  File "/home/tom/.local/bin/poetry", line 5, in <module>
    from poetry.console import main
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/__init__.py", line 1, in <module>
    from .application import Application
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/application.py", line 7, in <module>
    from .commands.about import AboutCommand
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/commands/__init__.py", line 4, in <module>
    from .check import CheckCommand
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/commands/check.py", line 2, in <module>
    from poetry.factory import Factory
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/factory.py", line 16, in <module>
    from .packages.locker import Locker
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/packages/__init__.py", line 2, in <module>
    from .locker import Locker
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/packages/locker.py", line 38, in <module>
    from poetry.utils.extras import get_extra_package_names
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/utils/extras.py", line 7, in <module>
    from poetry.utils.helpers import canonicalize_name
  File "/home/tom/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/utils/helpers.py", line 11, in <module>
    import requests
  File "/home/tom/.local/lib/python3.8/site-packages/requests/__init__.py", line 44, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'

🔬 How To Reproduce

Steps to reproduce the behavior:

  1. make install
  2. make pre-commit-install

Environment

            .-/+oossssoo+/-.               tom@desktop-20-3 
        `:+ssssssssssssssssss+:`           ---------------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 20.04.3 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: MS-7B00 1.0 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 5.11.0-44-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 135 days, 23 hours, 36 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 3579 (dpkg), 28 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 5.0.17 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+
ossyNMMMNyMMhsssssssssssssshmmmhssssssso
ossyNMMMNyMMhsssssssssssssshmmmhssssssso
+sssshhhyNMMNyssssssssssssyNMMMysssssss+
.ssssssssdMMMNhsssssssssshNMMMdssssssss.
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
  +sssssssssdmydMMMMMMMMddddyssssssss+
   /ssssssssssshdmNNNNmyNMMMMhssssss/
    .ossssssssssssssssssdMMMNysssso.
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.

python --version

Python 3.8.10

📈 Expected behavior

No error

@tom-doerr tom-doerr added the bug Something isn't working label May 25, 2022
@tom-doerr
Copy link
Author

It works when I run the command in a virtual environment.
Just installing chardet with pip install chardet or python3.8 -m pip install chardet did not work.

@donny-son
Copy link

Since this template uses poetry as the dependency manager, think you should use poetry add [package-name] for all additional dependencies. In your case poetry add chardet.

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

No branches or pull requests

2 participants