Python importerror no module named logging

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

ImportError: No module named ‘logger’ #103

ImportError: No module named ‘logger’ #103

Comments

I installed all the prerequisites following the docs for my Arch Linux install and when I get to python autorippr.py —test I get this message

Traceback (most recent call last):
File «autorippr.py», line 57, in
from classes import *
File «/home/bob/autoripper/Autorippr/classes/compression.py», line 15, in
import logger
ImportError: No module named ‘logger’

EDIT: I did «sudo pip install logger» and now when I run the python autorippr.py —test thingy I get «No module named ‘handbrake’ instead of logger. There does not appear to be a python module handbrake.

The text was updated successfully, but these errors were encountered:

Hey @raidermax, when you raised this issue you would have seen a link to the «guidelines for contributing to this repository» which would take you here: https://github.com/JasonMillward/Autorippr/blob/master/CONTRIBUTING.md#raising-an-issue

Can you please fill in your report with some more information to help me solve the problem?

@JasonMillward I did not see that link at all anywhere, my apologizes. And yes I can provide you with more info

General computer info
Arch Linux kernel 4.2.5
Arch Linux 4.2.5
Intel core i5 2400, AMD 7950 using radeonsi/mesa

Python
Okay so apparently I have a package called python which is versioned 2.7.10 and I have another package installed called «python» which is versioned 3.5.0

Читайте также:  Css dedicated server linux

Issue
Please see OP for issue

Traceback (most recent call last):
File «autorippr.py», line 57, in
from classes import *
File «/home/blah/autoripper/Autorippr/classes/compression.py», line 16, in
import handbrake
ImportError: No module named ‘handbrake’

I’m confused as to why that is happening, python should be loading the handbrake module from the classes directory.

init.py from 1.6.3 includes compression , handbrake and logger .

I’m going to spin up an Arch VM to see what’s going on, while I do that can you paste in the output of a tree just incase some files went missing (somehow), and just confirm that the python version you run is actually 2.7.10 with python —version since you can have multiple versions installed?

Should return something like this;

. ├── autorippr.log ├── autorippr.py ├── autorippr.sqlite ├── classes │ ├── analytics.py │ ├── compression.py │ ├── database.py │ ├── docopt.py │ ├── ffmpeg.py │ ├── filebot.py │ ├── handbrake.py │ ├── __init__.py │ ├── logger.py │ ├── makemkv.py │ ├── notification.py │ ├── pushover.py │ ├── smtp.py │ ├── stopwatch.py │ └── testing.py ├── CONTRIBUTING.md ├── LICENSE ├── NOTES.md ├── README.md ├── settings.cfg └── settings.example.cfg 

Apparently doing python —version is showing I am running 3.5.0 and not 2.7. so maybe that is why? I think Arch Linux requires python-3.5.0 for some core stuff. I could always try doing pacman -Rdd to remove python-3.5.0 without removing dependencies if I want to use autorippr right?, hopefully that wont break anything. Here is the tree btw

Autorippr/
├── autorippr.py
├── classes
│ ├── analytics.py
│ ├── compression.py
│ ├── database.py
│ ├── docopt.py
│ ├── ffmpeg.py
│ ├── filebot.py
│ ├── handbrake.py
│ ├── init.py
│ ├── logger.py
│ ├── makemkv.py
│ ├── pycache
│ │ ├── analytics.cpython-35.pyc
│ │ ├── compression.cpython-35.pyc
│ │ └── init.cpython-35.pyc
│ ├── stopwatch.py
│ └── testing.py
├── CONTRIBUTING.md
├── LICENSE
├── NOTES.md
├── README.md
├── settings.cfg
└── settings.example.cfg

(Side question, I used MakeMKV standalone today, noticed Autorippr uses MakeMKV also. does this bypass needing to use a license or is there a trial also?)

Apparently doing python —version is showing I am running 3.5.0 and not 2.7. so maybe that is why?

You should be able to change which version you use just by adding 2 or 3 to python, eg; python2 autorippr.py

Читайте также:  Javascript functions arguments default value

Give that a try just incase it is a python 3 issue.

(Side question, I used MakeMKV standalone today, noticed Autorippr uses MakeMKV also. does this bypass needing to use a license or is there a trial also?)

No it doesn’t bypass needing a licence, if you’re not aware MakeMKV is free while in beta.

Well, I think I can confirm it to be a python3 issue.

freyr :: ~/scripts/Autorippr ‹issue-102› % python3 autorippr.py --rip --debug Traceback (most recent call last): File "autorippr.py", line 58, in from classes import * File "/home/jason/scripts/Autorippr/classes/compression.py", line 15, in import logger ImportError: No module named 'logger' 

Источник

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

ImportError: No module named ‘logging’ #813

ImportError: No module named ‘logging’ #813

Comments

I’m on Windows 10, using Python 3.5 (user-local) and virtualenv 13.1.2

C:\Dev> python -m virtualenv pyenv Using base prefix 'C:\\Users\\Te-jé\\AppData\\Local\\Programs\\Python\\Python35-32' New python executable in pyenv\Scripts\python.exe Installing setuptools, pip, wheel. Complete output from command C:\Dev\pyenv\Scripts\python.exe -c "import sys, pip; sys. d\"] + sys.argv[1:]))" setuptools pip wheel: Traceback (most recent call last): File "", line 1, in File "C:\Users\Te-jé\AppData\Local\Programs\Python\Python35-32\lib\site-packages\virtualenv_support\pip-7.1.2-py2.py3-none-any.whl\pip\__init__.py", line 4, in ImportError: No module named 'logging' ---------------------------------------- . Installing setuptools, pip, wheel. done. Traceback (most recent call last): File "C:\Users\Te-jé\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "C:\Users\Te-jé\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Te-jé\AppData\Local\Programs\Python\Python35-32\lib\site-packages\virtualenv.py", line 2363, in main() File "C:\Users\Te-jé\AppData\Local\Programs\Python\Python35-32\lib\site-packages\virtualenv.py", line 832, in main symlink=options.symlink) File "C:\Users\Te-jé\AppData\Local\Programs\Python\Python35-32\lib\site-packages\virtualenv.py", line 1004, in create_environment install_wheel(to_install, py_executable, search_dirs) File "C:\Users\Te-jé\AppData\Local\Programs\Python\Python35-32\lib\site-packages\virtualenv.py", line 969, in install_wheel 'PIP_NO_INDEX': '1' File "C:\Users\Te-jé\AppData\Local\Programs\Python\Python35-32\lib\site-packages\virtualenv.py", line 910, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command C:\Dev\pyenv\Scripts\python.exe -c "import sys, pip; sys. d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1 

The text was updated successfully, but these errors were encountered:

Читайте также:  Php array access exception

Источник

Python doesn’t work: ImportError: No module named ‘logging’

I’m experiencing a very strange issue on my Digitalocean Ubuntu droplet, where Python 2.7 gives me the following error:

 from instagram import InstagramAuthentication, InstagramAPI File "/root/instagram_insights/socialgraphs-final-assignment/instagram.py", line 1, in import requests File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 55, in import urllib3 File "/usr/lib/python2.7/dist-packages/urllib3/__init__.py", line 10, in from .connectionpool import ( File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 2, in import logging ImportError: No module named logging 

In fact, I can’t do anything with Python:

  1. If I’m trying to reinstall python through apt-get I get the same error
  2. If I’m trying to execute a any pip command, e.g. pip search logging , I get the error
  3. I can’t even create a new virtualenv by doing virtualenv venv without getting the same error

My PYTHONPATH looks like this:

[», ‘/usr/local/lib/python2.7/dist-packages/gunicorn-19.3.0-py2.7.egg’, ‘/usr/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7’, ‘/usr/lib/python2.7/plat-x86_64-linux-gnu’, ‘/usr/lib/python2.7/lib-tk’, ‘/usr/lib/python2.7/lib-old’, ‘/usr/lib/python2.7/lib-dynload’, ‘/usr/local/lib/python2.7/dist-packages’]

The funny thing is that the error appeared out of the blue until I restarted gunicorn, which is the WSGI server I’m using to host my Flask site.

Before it happened I was fiddling with logs in nginx , but I can’t see how that should have affected my Python installation.

Best Solution

Make sure you use system-wide python and not virtualenv-from-somewhere:

Try to find out where this module is located:

sudo updatedb locate logging | grep python 

Then try adding this path to PYTHONPATH

Источник

Stuck on an issue?

question-mark

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Talk to a Lightrun Answers expert

[Bug] ModuleNotFoundError: no module named ‘logging.config’

Issue Description

To reproduce

** Minimal Code/Config snippet to reproduce **

#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import hydra log = logging.getLogger(__name__) @hydra.main() def my_app(_cfg): log.info('info level message') log.debug('debug level message') 
Traceback (most recent call last): File "logging.py", line 4, in import logging File "$HOME/workspace/hydra_test/logging.py", line 5, in import hydra File "$HOME/miniconda3/lib/python3.7/site-packages/hydra/__init__.py", line 2, in from . import utils File "$HOME/miniconda3/lib/python3.7/site-packages/hydra/utils.py", line 2, in import logging.config ModuleNotFoundError: No module named 'logging.config'; 'logging' is not a package 

Expected Behavior

executes successfully (without package import error)

System information

Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux

Источник

Оцените статью