Python выдает длинную информацию о том, что модули уничтожаются - PullRequest
0 голосов
/ 29 июня 2019

Итак, я разрешал некоторые конфликты слияния, когда получил это сообщение:

commentaryAT/models.py: line 15: syntax error near unexpected token `('

Строка, на которую это ссылается, выглядела так:

from __future__ import (absolute_import, division, print_function, unicode_literals)

Сразу за этим я также получилэта ошибка:

(hattie-nHCNXwaX) malikarumi@Tetuoan2:~/Projects/hattie$ 
commentaryAT/models.py
from: too many arguments
import-im6.q16: not authorized `uuid' @ 
error/constitute.c/WriteImage/1037.
from: too many arguments
from: too many arguments
from: too many arguments

Обратите внимание, что из-за моего разочарования я слишком быстро двигался и забыл поставить 'git add' перед командой 'commentaryAT / models.py'

Итак, мыЭти две ошибки повторялись, и я не был удовлетворен тем, что я делал, чтобы успокоить их, и я подумал, не было ли это какой-то странной ошибкой Python2, поэтому я решил проверить версию, несмотря на то, что был внутри virtualenv.Теперь это кажется огромной ошибкой:

(hattie-nHCNXwaX) malikarumi@Tetuoan2:~/Projects/hattie$ python -v
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__init__.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/codecs.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/codecs.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/codecs.cpython-37.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb8a278>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__pycache__/aliases.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/aliases.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__pycache__/aliases.cpython-37.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb9ac50>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cbfacc0>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__pycache__/utf_8.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/utf_8.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__pycache__/utf_8.cpython-37.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cba9978>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__pycache__/latin_1.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/latin_1.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/encodings/__pycache__/latin_1.cpython-37.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cbaf470>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/io.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/io.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/io.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/abc.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/abc.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/abc.cpython-37.pyc'
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cbafa58>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cbaf6a0>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/site.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/site.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/site.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/os.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/os.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/os.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/stat.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/stat.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/stat.cpython-37.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb4e470>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/posixpath.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/posixpath.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/posixpath.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/genericpath.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/genericpath.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/genericpath.cpython-37.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb50eb8>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb4eb38>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/_collections_abc.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb5d550>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb420b8>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/_bootlocale.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc'
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb42438>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/types.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/types.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/types.cpython-37.pyc'
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cafd390>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__pycache__/__init__.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__init__.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__pycache__/__init__.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/warnings.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/warnings.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/warnings.cpython-37.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735caf8080>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cafd438>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__pycache__/util.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/util.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__pycache__/util.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__pycache__/abc.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/abc.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__pycache__/abc.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__pycache__/machinery.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/machinery.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/importlib/__pycache__/machinery.cpython-37.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb05be0>
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb05390>
# /usr/local/lib/python3.7/__pycache__/contextlib.cpython-37.pyc matches /usr/local/lib/python3.7/contextlib.py
# code object from '/usr/local/lib/python3.7/__pycache__/contextlib.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/collections/__pycache__/__init__.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/collections/__init__.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/collections/__pycache__/__init__.cpython-37.pyc'
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/operator.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/operator.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/operator.cpython-37.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735b9d0e10>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/keyword.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/keyword.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/keyword.cpython-37.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735b9d9f98>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/heapq.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/heapq.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/heapq.cpython-37.pyc'
# extension module '_heapq' loaded from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/lib-dynload/_heapq.cpython-37m-x86_64-linux-gnu.so'
# extension module '_heapq' executed from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/lib-dynload/_heapq.cpython-37m-x86_64-linux-gnu.so'
import '_heapq' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f735b9e2e48>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735b9e2908>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/reprlib.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/reprlib.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/reprlib.cpython-37.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735b9e2f28>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb19fd0>
# /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/functools.cpython-37.pyc matches /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/functools.py
# code object from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/__pycache__/functools.cpython-37.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735b9b7400>
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cb14898>
import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735caf8668>
# possible namespace for /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/site-packages/zope
# possible namespace for /home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/site-packages/zope
# destroy zope
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x7f735cbb4630>
Python 3.7.1 (default, Dec 19 2018, 17:20:49) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
# extension module 'readline' loaded from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/lib-dynload/readline.cpython-37m-x86_64-linux-gnu.so'
# extension module 'readline' executed from '/home/malikarumi/.local/share/virtualenvs/hattie-nHCNXwaX/lib/python3.7/lib-dynload/readline.cpython-37m-x86_64-linux-gnu.so'
import 'readline' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f735caec1d0>
>>> exit()
# clear builtins._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.__interactivehook__
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup[2] removing sys
# cleanup[2] removing builtins
# cleanup[2] removing _frozen_importlib
# cleanup[2] removing _imp
# cleanup[2] removing _thread
# cleanup[2] removing _warnings
# cleanup[2] removing _weakref
# cleanup[2] removing zipimport
# cleanup[2] removing _frozen_importlib_external
# cleanup[2] removing _io
# cleanup[2] removing marshal
# cleanup[2] removing posix
# cleanup[2] removing encodings
# destroy encodings
# cleanup[2] removing codecs
# cleanup[2] removing _codecs
# cleanup[2] removing encodings.aliases
# cleanup[2] removing encodings.utf_8
# cleanup[2] removing _signal
# cleanup[2] removing __main__
# destroy __main__
# cleanup[2] removing encodings.latin_1
# cleanup[2] removing io
# destroy io
# cleanup[2] removing abc
# cleanup[2] removing _abc
# cleanup[2] removing site
# destroy site
# cleanup[2] removing os
# cleanup[2] removing stat
# cleanup[2] removing _stat
# cleanup[2] removing posixpath
# cleanup[2] removing genericpath
# cleanup[2] removing os.path
# cleanup[2] removing _collections_abc
# cleanup[2] removing _bootlocale
# destroy _bootlocale
# cleanup[2] removing _locale
# cleanup[2] removing types
# cleanup[2] removing importlib
# destroy importlib
# cleanup[2] removing importlib._bootstrap
# cleanup[2] removing importlib._bootstrap_external
# cleanup[2] removing warnings
# cleanup[2] removing importlib.util
# cleanup[2] removing importlib.abc
# cleanup[2] removing importlib.machinery
# cleanup[2] removing contextlib
# destroy contextlib
# cleanup[2] removing collections
# destroy collections
# cleanup[2] removing operator
# destroy operator
# cleanup[2] removing _operator
# cleanup[2] removing keyword
# destroy keyword
# cleanup[2] removing heapq
# cleanup[2] removing _heapq
# cleanup[2] removing itertools
# cleanup[2] removing reprlib
# destroy reprlib
# cleanup[2] removing _collections
# cleanup[2] removing functools
# cleanup[2] removing _functools
# cleanup[2] removing zope
# destroy zope
# cleanup[2] removing readline
# destroy zipimport
# destroy _signal
# destroy posixpath
# destroy _stat
# destroy genericpath
# destroy os
# destroy stat
# destroy _locale
# destroy importlib.util
# destroy importlib.abc
# destroy functools
# destroy types
# destroy importlib.machinery
# destroy warnings
# destroy abc
# destroy _collections_abc
# destroy heapq
# destroy _operator
# destroy _heapq
# destroy itertools
# destroy _collections
# destroy _abc
# destroy _functools
# destroy readline
# cleanup[3] wiping _frozen_importlib
# destroy _frozen_importlib_external
# cleanup[3] wiping _imp
# cleanup[3] wiping _thread
# cleanup[3] wiping _warnings
# cleanup[3] wiping _weakref
# cleanup[3] wiping _io
# cleanup[3] wiping marshal
# cleanup[3] wiping posix
# cleanup[3] wiping codecs
# cleanup[3] wiping _codecs
# cleanup[3] wiping encodings.aliases
# cleanup[3] wiping encodings.utf_8
# cleanup[3] wiping encodings.latin_1
# cleanup[3] wiping importlib._bootstrap
# cleanup[3] wiping sys
# cleanup[3] wiping builtins
(hattie-nHCNXwaX) malikarumi@Tetuoan2:~/Projects/hattie$```

I have no idea what most of that means, but I do find words like "wiping" and "destroy" disconcerting in this context. I googled around, and most of my hits were from bugs.python.org. 

https://bugs.python.org/issue33719
In this one no less than Ned Batchelder posted a very long out put similar to what I pasted here. He also had just used the 'python -v' command. But they report that issue as fixed and closed. I got a similar output but from a different cause. He was using Pydoc at the time. 

How serious is this? Have I actually lost all these files? What can be done about it?

1 Ответ

1 голос
/ 29 июня 2019

Команда python -v предназначена для подробного вывода (читай: отладочный вывод).Вывод, который вы получаете, вполне нормален.

Введите python -V (заглавная V), если вы просто хотите проверить версию; -)

Это соответствующая часть справки (python -?):

-v     : verbose (trace import statements); also PYTHONVERBOSE=x
         can be supplied multiple times to increase verbosity
-V     : print the Python version number and exit (also --version)
         when given twice, print more information about the build
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...