Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何恢复旧python_Python - Fatal编程技术网

如何恢复旧python

如何恢复旧python,python,Python,我想将我的mac恢复为只使用python2,因为我认为我在安装python3时做错了什么。现在我明白了: python -v # installing zipimport hook import zipimport # builtin # installed zipimport hook # /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc matches /System/Library

我想将我的mac恢复为只使用python2,因为我认为我在安装python3时做错了什么。现在我明白了:

python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py
import site # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py
import os # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py
import posixpath # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.py
import stat # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py
import genericpath # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.py
import warnings # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py
import linecache # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py
import types # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py
import UserDict # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py
import abc # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc
# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
我做了什么

我只是不知道错误是什么。还有一个问题:

dbconf -a lms -d wu-llm -e prod get lms_core.db_root_pwd
Traceback (most recent call last):
  File "/usr/local/bin/dbconf", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/dbconf/__init__.py", line 418, in main
    args.func(get_domains(args), args)
  File "/usr/local/lib/python2.7/site-packages/dbconf/__init__.py", line 66, in get_domains
    return [get_domain(domain, args.app, env) for env in args.environments for domain in args.domains]
  File "/usr/local/lib/python2.7/site-packages/dbconf/__init__.py", line 60, in get_domain
    parser.error("domain does not exist: %s" % name)
AttributeError: 'NoneType' object has no attribute 'error'
dbconf-a lms-d wu llm-e prod get lms_core.db_root_pwd
回溯(最近一次呼叫最后一次):
文件“/usr/local/bin/dbconf”,第8行,在
sys.exit(main())
文件“/usr/local/lib/python2.7/site packages/dbconf/_init__.py”,主目录第418行
args.func(获取域(args),args)
get_域中的文件“/usr/local/lib/python2.7/site packages/dbconf/_init__uuu.py”,第66行
返回[get_domain(domain,args.app,env)for args.environments for domain in args.domains]
get_域中的文件“/usr/local/lib/python2.7/site packages/dbconf/_init__uuu.py”,第60行
解析程序。错误(“域不存在:%s”%name)
AttributeError:“非类型”对象没有属性“错误”

。请不要问重复的问题。如果您想添加详细信息,可以添加。这是否回答了您的问题?不,不是。不确定这是否是“如何将python命令更改为再次使用python 2”的副本。python2还在你的系统中吗?(使用例如
find/| grep python$
检查python可执行文件的位置)如果是,这是一个重复的问题。如果没有,您首先需要再次安装python2。