- No module named css
- Related articles
- Решение ошибки «ModuleNotFoundError: No module named ‘…’»
- Модуль не установлен
- Конфликт имен библиотеки и модуля
- Конфликт зависимостей модулей Python
- Saved searches
- Use saved searches to filter your results more quickly
- calibre fails to start: ImportError: No module named css_parser.css #53973
- calibre fails to start: ImportError: No module named css_parser.css #53973
- Comments
- Issue description
- Steps to reproduce
- Technical details
No module named css
I put python3.6.4 by pyenv on centos.
After that, I put natto by pip install natto-py .
However, when I try to execute from natto import MeCab , I get an error No module named’_css’ .
According to the error,
/home/UserName/.pyenv/versions/3.6.4/lib/python3.6/site-packages/natto
Looking at the subordinate directory, there is no _css directory and there is a _css.py file.
I think it would be
/home/UserName/.pyenv/versions/3.6.4/lib/python3.6/site-packages/natto/__ init __. py
I changed the code of the above file as follows.
from _css import css ↓ import _css
Are there anyone who has a similar situation?
I’m sorry self-solved. There are probably two reasons,
There may have been a problem with the python version and command when installing natto. python3.6.4 => python3.6.0 pip install natto => pip install natto-py
I was able to solve it by changing it as above!
Related articles
- i get a no module named error when i try to run a program in python
- python — the «no module named’torch'» error persists!
- python seleniun error modulenotfounderror: no module named’selenium’
- could not import the lzma module your installed python is incomplete about attempting to use lzma
- python: can the function called in main () refer to the ftp module? nameerror
- python 3x — [python] no module named’math’
- python — the code in the module doesn’t work even though i imported it
- i don’t know how to write [python requests module] corresponding to [curl -f hoge = ・ ・]
- python 3x — i’m trying to execute python code but the math is very slow
- python — self-made module appapp cannot be imported
- python — about nameerror when trying to run cython on jupyter lab
- python 3x — i want to see the contents of the queue with the python queue module
- [python] when importing pandas on vs code, the error «the specified module cannot be found» is displayed
- python — when trying to compress a file in a folder with a zip file with the file name acquired by oswalk, if there are subfolde
- python matplotlibpyplot i get an error trying to display a moving average on a candlestick chart
- file gets corrupted when trying to edit a pdf file in python
- python — ephem module cannot be imported in vscode
- [python] an error message appears when trying to convert a string of numbers entered in input to a float function
- python — returns invalid_grant when trying to log in with discord using rauth
- python — i get an import error on an installed module
Решение ошибки «ModuleNotFoundError: No module named ‘…’»
В Python может быть несколько причин возникновения ошибки ModuleNotFoundError: No module named . :
- Модуль Python не установлен.
- Есть конфликт в названиях пакета и модуля.
- Есть конфликт зависимости модулей Python.
Рассмотрим варианты их решения.
Модуль не установлен
В первую очередь нужно проверить, установлен ли модуль. Для использования модуля в программе его нужно установить. Например, если попробовать использовать numpy без установки с помощью pip install будет следующая ошибка:
Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy'
Для установки нужного модуля используйте следующую команду:
pip install numpy # или pip3 install numpy
Или вот эту если используете Anaconda:
Учтите, что может быть несколько экземпляров Python (или виртуальных сред) в системе. Модуль нужно устанавливать в определенный экземпляр.
Конфликт имен библиотеки и модуля
Еще одна причина ошибки No module named — конфликт в названиях пакета и модуля. Предположим, есть следующая структура проекта Python:
demo-project └───utils __init__.py string_utils.py utils.py
Если использовать следующую инструкцию импорта файла utils.py, то Python вернет ошибку ModuleNotFoundError .
>>> import utils.string_utils
Traceback (most recent call last):
File "C:\demo-project\utils\utils.py", line 1, in
import utils.string_utils
ModuleNotFoundError: No module named 'utils.string_utils';
'utils' is not a packageВ сообщении об ошибке сказано, что «utils is not a package». utils — это имя пакета, но это также и имя модуля. Это приводит к конфликту, когда имя модуля перекрывает имя пакета/библиотеки. Для его разрешения нужно переименовать файл utils.py.
Конфликт зависимостей модулей Python
Иногда может существовать конфликт модулей Python, который и приводит к ошибке No module named.
Следующее сообщение явно указывает, что _numpy_compat.py в библиотеке scipy пытается импортировать модуль numpy.testing.nosetester .
Traceback (most recent call last): File "C:\demo-project\venv\ Lib\site-packages\ scipy\_lib\_numpy_compat.py", line 10, in from numpy.testing.nosetester import import_nose ModuleNotFoundError: No module named 'numpy.testing.nosetester'
Ошибка ModuleNotFoundError возникает из-за того, что модуль numpy.testing.nosetester удален из библиотеки в версии 1.18. Для решения этой проблемы нужно обновить numpy и scipy до последних версий.
pip install numpy --upgrade pip install scipy --upgrade
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
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
calibre fails to start: ImportError: No module named css_parser.css #53973
calibre fails to start: ImportError: No module named css_parser.css #53973
Comments
Issue description
When Calibre starts on latest nixos-unstable (3.37), it gives the error: "There was an error during calibre startup. Parts of calibre may not function." With the detailed text:
calibre, version 3.37.0 ERROR: Startup error: There was an error during calibre startup. Parts of calibre may not function. Click Show details to learn more. Traceback (most recent call last): File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/main.py", line 290, in initialize_db_stage2 self.start_gui(db) File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/main.py", line 229, in start_gui main = self.main = Main(self.opts, gui_debug=self.gui_debug) File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/ui.py", line 157, in __init__ ac = self.init_iaction(action) File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/ui.py", line 171, in init_iaction ac = action.load_actual_plugin(self) File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/customize/__init__.py", line 612, in load_actual_plugin ac = getattr(importlib.import_module(mod), cls)(gui, File "/nix/store/l95nkqp7bdimqnz9ixay1aahljzsz7vc-python-2.7.15/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/actions/catalog.py", line 13, in from calibre.gui2.tools import generate_catalog File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/tools.py", line 16, in from calibre.gui2.convert.single import Config as SingleConfig File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/convert/single.py", line 18, in from calibre.gui2.convert.look_and_feel import LookAndFeelWidget File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/convert/look_and_feel.py", line 13, in from calibre.gui2.convert.look_and_feel_ui import Ui_Form File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/convert/look_and_feel_ui.py", line 286, in from calibre.gui2.css_transform_rules import RulesWidget File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/gui2/css_transform_rules.py", line 13, in from calibre.ebooks.css_transform_rules import ( File "/nix/store/x0c3c5lb21zxlzxbw29ilv1fnvsdln1y-calibre-3.37.0/lib/calibre/calibre/ebooks/css_transform_rules.py", line 11, in from css_parser.css import Property, CSSRule ImportError: No module named css_parser.css
Might be due to kovidgoyal/calibre@dd7d8ea switching Calibre to use css-parser, which seems like it isn't packaged in nixpkgs?
Seems like #53636 didn't catch the issue.
Steps to reproduce
Technical details
- system: `"x86_64-linux"` - host os: `Linux 4.19.14, NixOS, 19.03.git.f1cc4b7 (Koi)` - multi-user?: `yes` - sandbox: `yes` - version: `nix-env (Nix) 2.2` - channels(root): `""` - nixpkgs: `/etc/nixos/nixpkgs`
The text was updated successfully, but these errors were encountered: