启动任何 python 程序时出现 os.path.exist(path) 错误

发布于 2024-11-04 15:34:20 字数 3899 浏览 0 评论 0 原文

我不明白为什么我在以下几行中收到递归深度错误

source = zipfile.ZipFile( "E:\\Zip Files\\80348.zip' , 'r' )
source.extractall()

文件存在并且我能够打开它。我得到的回溯是,

Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python26\lib\zipfile.py", line 940, in extractall
 self.extract(zipinfo, path, pwd)
File "C:\Python26\lib\zipfile.py", line 928, in extract
 return self._extract_member(member, path, pwd)
File "C:\Python26\lib\zipfile.py", line 961, in _extract_member
 if upperdirs and not os.path.exists(upperdirs):
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)

你能告诉我这里出了什么问题吗......

编辑:-

嘿,我刚刚发现这不是来自zipfile的错误......我运行任何其他 python 程序,我都会得到相同的错误......

当我在命令行上键入 python 时,我收到错误

Exception RuntimeError: 'maximum recursion Derecessed in __subclasscheck__' 在<类型'异常.RuntimeError'>中被忽略 异常运行时错误:“调用 Python 时超出最大递归深度” 中的对象'被忽略 “导入站点”失败;使用 -v 进行回溯

我不认为该错误与 zipfile 有关,因为我也看到了这个链接.... 导入站点错误

我尝试使用 -v 并得到以下回溯

# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# C:\Python26\lib\site.pyc matches C:\Python26\lib\site.py
import site # precompiled from C:\Python26\lib\site.pyc
# C:\Python26\lib\os.pyc matches C:\Python26\lib\os.py
import os # precompiled from C:\Python26\lib\os.pyc
import errno # builtin
import nt # builtin
# C:\Python26\lib\ntpath.pyc matches C:\Python26\lib\ntpath.py
import ntpath # precompiled from C:\Python26\lib\ntpath.pyc
# C:\Python26\lib\stat.pyc matches C:\Python26\lib\stat.py
import stat # precompiled from C:\Python26\lib\stat.pyc
# C:\Python26\lib\genericpath.pyc matches C:\Python26\lib\genericpath.py
import genericpath # precompiled from C:\Python26\lib\genericpath.pyc
# C:\Python26\lib\warnings.pyc matches C:\Python26\lib\warnings.py
import warnings # precompiled from C:\Python26\lib\warnings.pyc
# C:\Python26\lib\linecache.pyc matches C:\Python26\lib\linecache.py
import linecache # precompiled from C:\Python26\lib\linecache.pyc
# C:\Python26\lib\types.pyc matches C:\Python26\lib\types.py
import types # precompiled from C:\Python26\lib\types.pyc
# C:\Python26\lib\UserDict.pyc matches C:\Python26\lib\UserDict.py
import UserDict # precompiled from C:\Python26\lib\UserDict.pyc
# C:\Python26\lib\_abcoll.pyc matches C:\Python26\lib\_abcoll.py
import _abcoll # precompiled from C:\Python26\lib\_abcoll.pyc
# C:\Python26\lib\abc.pyc matches C:\Python26\lib\abc.py
import abc # precompiled from C:\Python26\lib\abc.pyc
# C:\Python26\lib\copy_reg.pyc matches C:\Python26\lib\copy_reg.py
import copy_reg # precompiled from C:\Python26\lib\copy_reg.pyc
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__'
in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python
object' in <type 'exceptions.RuntimeError'> ignored
'import site' failed; traceback:
Traceback (most recent call last):
File "C:\Python26\Lib\site.py", line 513, in <module>
main()
File "C:\Python26\Lib\site.py", line 496, in main
known_paths = addsitepackages(known_paths)
File "C:\Python26\Lib\site.py", line 288, in addsitepackages
addsitedir(sitedir, known_paths)
File "C:\Python26\Lib\site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "C:\Python26\Lib\site.py", line 159, in addpackage
if not dircase in known_paths and os.path.exists(dir):
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)

我应该做什么...有谁面临同样的问题?

I don't understand why I am getting a recursion depth error in the following lines

source = zipfile.ZipFile( "E:\\Zip Files\\80348.zip' , 'r' )
source.extractall()

The file exists and I am able to open it. The Traceback I get is that

Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python26\lib\zipfile.py", line 940, in extractall
 self.extract(zipinfo, path, pwd)
File "C:\Python26\lib\zipfile.py", line 928, in extract
 return self._extract_member(member, path, pwd)
File "C:\Python26\lib\zipfile.py", line 961, in _extract_member
 if upperdirs and not os.path.exists(upperdirs):
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)

Could you tell what is going wrong here ......

EDIT :-

Hey , I just found out that this is not an error coming from zipfile.... I run any other python program I get the same error....

When I type python on the command line I get the error

Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__'
in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python
object' in <type 'exceptions.RuntimeError'> ignored
'import site' failed; use -v for traceback

I don't think the error is related to zipfile because I also saw this link.... import site error

I tried with -v and i got the following traceback

# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# C:\Python26\lib\site.pyc matches C:\Python26\lib\site.py
import site # precompiled from C:\Python26\lib\site.pyc
# C:\Python26\lib\os.pyc matches C:\Python26\lib\os.py
import os # precompiled from C:\Python26\lib\os.pyc
import errno # builtin
import nt # builtin
# C:\Python26\lib\ntpath.pyc matches C:\Python26\lib\ntpath.py
import ntpath # precompiled from C:\Python26\lib\ntpath.pyc
# C:\Python26\lib\stat.pyc matches C:\Python26\lib\stat.py
import stat # precompiled from C:\Python26\lib\stat.pyc
# C:\Python26\lib\genericpath.pyc matches C:\Python26\lib\genericpath.py
import genericpath # precompiled from C:\Python26\lib\genericpath.pyc
# C:\Python26\lib\warnings.pyc matches C:\Python26\lib\warnings.py
import warnings # precompiled from C:\Python26\lib\warnings.pyc
# C:\Python26\lib\linecache.pyc matches C:\Python26\lib\linecache.py
import linecache # precompiled from C:\Python26\lib\linecache.pyc
# C:\Python26\lib\types.pyc matches C:\Python26\lib\types.py
import types # precompiled from C:\Python26\lib\types.pyc
# C:\Python26\lib\UserDict.pyc matches C:\Python26\lib\UserDict.py
import UserDict # precompiled from C:\Python26\lib\UserDict.pyc
# C:\Python26\lib\_abcoll.pyc matches C:\Python26\lib\_abcoll.py
import _abcoll # precompiled from C:\Python26\lib\_abcoll.pyc
# C:\Python26\lib\abc.pyc matches C:\Python26\lib\abc.py
import abc # precompiled from C:\Python26\lib\abc.pyc
# C:\Python26\lib\copy_reg.pyc matches C:\Python26\lib\copy_reg.py
import copy_reg # precompiled from C:\Python26\lib\copy_reg.pyc
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__'
in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python
object' in <type 'exceptions.RuntimeError'> ignored
'import site' failed; traceback:
Traceback (most recent call last):
File "C:\Python26\Lib\site.py", line 513, in <module>
main()
File "C:\Python26\Lib\site.py", line 496, in main
known_paths = addsitepackages(known_paths)
File "C:\Python26\Lib\site.py", line 288, in addsitepackages
addsitedir(sitedir, known_paths)
File "C:\Python26\Lib\site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "C:\Python26\Lib\site.py", line 159, in addpackage
if not dircase in known_paths and os.path.exists(dir):
File "C:\Python26\lib\genericpath.py", line 18, in exists
 st = os.path.exists(path)

What should I do ... Has anyone faced the same problem ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文