gpt4 book ai didi

python - 在 Windows vista 上安装 Python 3.4.4 后检查版本会出现意外结果

转载 作者:行者123 更新时间:2023-11-28 20:40:54 25 4
gpt4 key购买 nike

我最近刚刚通过运行安装程序并更改环境变量安装了 Python 3.4.4。我还尝试了一些简单的命令来查看它是否安装正确并且是。然而,当我在命令行中输入 python -v 时,我得到的是:

import _frozen_importlib # frozen
import imp # builtin
import sys # builtin
# installing zipimport hook
# installed zipimport hook
# C:\Python34\lib\encodings\__pycache__\__init__.cpython-34.pyc matches C:\Pytho
n34\lib\encodings\__init__.py
# code object from 'C:\\Python34\\lib\\encodings\\__pycache__\\__init__.cpython-
34.pyc'
# C:\Python34\lib\__pycache__\codecs.cpython-34.pyc matches C:\Python34\lib\code
cs.py
# code object from 'C:\\Python34\\lib\\__pycache__\\codecs.cpython-34.pyc'
import 'codecs' # <_frozen_importlib.SourceFileLoader object at 0x01EC1170>
# C:\Python34\lib\encodings\__pycache__\aliases.cpython-34.pyc matches C:\Python
34\lib\encodings\aliases.py
# code object from 'C:\\Python34\\lib\\encodings\\__pycache__\\aliases.cpython-3
4.pyc'
import 'encodings.aliases' # <_frozen_importlib.SourceFileLoader object at 0x01E
C6E90>
import 'encodings' # <_frozen_importlib.SourceFileLoader object at 0x01D83C30>
# C:\Python34\lib\encodings\__pycache__\mbcs.cpython-34.pyc matches C:\Python34\
lib\encodings\mbcs.py
# code object from 'C:\\Python34\\lib\\encodings\\__pycache__\\mbcs.cpython-34.p
yc'
import 'encodings.mbcs' # <_frozen_importlib.SourceFileLoader object at 0x01EC62
F0>
# C:\Python34\lib\encodings\__pycache__\utf_8.cpython-34.pyc matches C:\Python34
\lib\encodings\utf_8.py
# code object from 'C:\\Python34\\lib\\encodings\\__pycache__\\utf_8.cpython-34.
pyc'
import 'encodings.utf_8' # <_frozen_importlib.SourceFileLoader object at 0x01ED9
190>
# C:\Python34\lib\encodings\__pycache__\latin_1.cpython-34.pyc matches C:\Python
34\lib\encodings\latin_1.py
# code object from 'C:\\Python34\\lib\\encodings\\__pycache__\\latin_1.cpython-3
4.pyc'
import 'encodings.latin_1' # <_frozen_importlib.SourceFileLoader object at 0x01E
D92B0>
# C:\Python34\lib\__pycache__\io.cpython-34.pyc matches C:\Python34\lib\io.py
# code object from 'C:\\Python34\\lib\\__pycache__\\io.cpython-34.pyc'
# C:\Python34\lib\__pycache__\abc.cpython-34.pyc matches C:\Python34\lib\abc.py
# code object from 'C:\\Python34\\lib\\__pycache__\\abc.cpython-34.pyc'
# C:\Python34\lib\__pycache__\_weakrefset.cpython-34.pyc matches C:\Python34\lib
\_weakrefset.py
# code object from 'C:\\Python34\\lib\\__pycache__\\_weakrefset.cpython-34.pyc'
import '_weakrefset' # <_frozen_importlib.SourceFileLoader object at 0x01ED99F0>

import 'abc' # <_frozen_importlib.SourceFileLoader object at 0x01ED9550>
import 'io' # <_frozen_importlib.SourceFileLoader object at 0x01ED93B0>
# C:\Python34\lib\encodings\__pycache__\cp437.cpython-34.pyc matches C:\Python34
\lib\encodings\cp437.py
# code object from 'C:\\Python34 \\lib\\encodings\\__pycache__\\cp437.cpython-34.
pyc'
import 'encodings.cp437' # <_frozen_importlib.SourceFileLoader object at 0x01EE4
7D0>
# C:\Python34\lib\__pycache__\site.cpython-34.pyc matches C:\Python34\lib\site.p
y
# code object from 'C:\\Python34\\lib\\__pycache__\\site.cpython-34.pyc'
# C:\Python34\lib\__pycache__\os.cpython-34.pyc matches C:\Python34\lib\os.py
# code object from 'C:\\Python34\\lib\\__pycache__\\os.cpython-34.pyc'
# C:\Python34\lib\__pycache__\stat.cpython-34.pyc matches C:\Python34\lib\stat.p
y
# code object from 'C:\\Python34\\lib\\__pycache__\\stat.cpython-34.pyc'
import 'stat' # <_frozen_importlib.SourceFileLoader object at 0x01EF91D0>
# C:\Python34\lib\__pycache__\ntpath.cpython-34.pyc matches C:\Python34\lib\ntpa
th.py
# code object from 'C:\\Python34\\lib\\__pycache__\\ntpath.cpython-34.pyc'
# C:\Python34\lib\__pycache__\genericpath.cpython-34.pyc matches C:\Python34\lib
\genericpath.py
# code object from 'C:\\Python34\\lib\\__pycache__\\genericpath.cpython-34.pyc'
import 'genericpath' # <_frozen_importlib.SourceFileLoader object at 0x01EFE330>

import 'ntpath' # <_frozen_importlib.SourceFileLoader object at 0x01EF9590>
# C:\Python34\lib\__pycache__\_collections_abc.cpython-34.pyc matches C:\Python3
4\lib\_collections_abc.py
# code object from 'C:\\Python34\\lib\\__pycache__\\_collections_abc.cpython-34.
pyc'
import '_collections_abc' # <_frozen_importlib.SourceFileLoader object at 0x01EF
E630>
import 'os' # <_frozen_importlib.SourceFileLoader object at 0x01EEE610>
# C:\Python34\lib\__pycache__\_sitebuiltins.cpython-34.pyc matches C:\Python34\l
ib\_sitebuiltins.py
# code object from 'C:\\Python34\\lib\\__pycache__\\_sitebuiltins.cpython-34.pyc
'
import '_sitebuiltins' # <_frozen_importlib.SourceFileLoader object at 0x01EEE87
0>
# C:\Python34\lib\__pycache__\sysconfig.cpython-34.pyc matches C:\Python34\lib\s
ysconfig.py
# code object from 'C:\\Python34\\lib\\__pycache__\\sysconfig.cpython-34.pyc'
import 'sysconfig' # <_frozen_importlib.SourceFileLoader object at 0x01EEEAF0>
# C:\Python34\lib\__pycache__\_bootlocale.cpython-34.pyc matches C:\Python34\lib
\_bootlocale.py
# code object from 'C:\\Python34\\lib\\__pycache__\\_bootlocale.cpython-34.pyc'
import '_bootlocale' # <_frozen_importlib.SourceFileLoader object at 0x0242F9B0>

# C:\Python34\lib\encodings\__pycache__\cp1252.cpython-34.pyc matches C:\Python3
4\lib\encodings\cp1252.py
# code object from 'C:\\Python34\\lib\\encodings\\__pycache__\\cp1252.cpython-34
.pyc'
import 'encodings.cp1252' # <_frozen_importlib.SourceFileLoader object at 0x0242
FC90>
import 'site' # <_frozen_importlib.SourceFileLoader object at 0x01EE4A90>
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

或者,当我输入 python -version 时,这就是我得到的:

Unknown option: -e
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

所以我不确定是否有任何我安装错误的部分导致了这些。希望有人能帮忙。

最佳答案

您的安装没问题,-v 命令行选项不代表版本。

-v Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice, print a message for each file that is checked for when searching for a module. Also provides information on module cleanup at exit.

要检查版本,您必须使用 --version-V:

python --version

Python 试图在您使用单个连字符作为前缀时将版本的每个字符解释为单独的命令行选项。

通常作为命令行选项的单词以两个连字符为前缀,单个字符只有一个或没有。您可以阅读有关命令行选项的 POSIX 指南的更多信息 here .

关于python - 在 Windows vista 上安装 Python 3.4.4 后检查版本会出现意外结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34893723/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com