重新安装 Python 并重试。我试图重现这个错误。
尝试安装索引器:
Collecting indexer
Downloading indexer-0.6.2.tar.gz (14 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\fatalcoder524\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\fatalcoder524\\AppData\\Local\\Temp\\pip-install-btasoark\\indexer\\setup.py'"'"'; __file__='"'"'C:\\Users\\fatalcoder524\\AppData\\Local\\Temp\\pip-install-btasoark\\indexer\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\fatalcoder524\AppData\Local\Temp\pip-install-btasoark\indexer\pip-egg-info'
cwd: C:\Users\fatalcoder524\AppData\Local\Temp\pip-install-btasoark\indexer\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\fatalcoder524\AppData\Local\Temp\pip-install-btasoark\indexer\setup.py", line 107
except OSError, ex:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
尝试安装 python3-lzo-indexer:
Collecting python3-lzo-indexer
Downloading python3_lzo_indexer-0.3.0-py2.py3-none-any.whl (6.6 kB)
Requirement already satisfied: click==7.0 in c:\users\fatalcoder524\appdata\local\programs\python\python37\lib\site-packages (from python3-lzo-indexer) (7.0)
Installing collected packages: python3-lzo-indexer
Successfully installed python3-lzo-indexer-0.3.0
尝试使用python -m "import lzo_indexer" 使用索引器:
C:\Users\fatalcoder524\AppData\Local\Programs\Python\Python37\python.exe: No module named import lzo_indexer
尝试在python解释器中执行:
Python 3.7.0b3 (v3.7.0b3:4e7efa9c6f, Mar 29 2018, 18:42:04) [MSC v.1913 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import lzo_indexer
>>> dir(lzo_indexer)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'get_lzo_blocks', 'index_lzo_file', 'indexer']