Traceback (most recent call last): File "E:\pythonproject\lab1.py", line 49, in <module> import sympy File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\__init__.py", line 51, in <module> from .core import (sympify, SympifyError, cacheit, Basic, Atom, File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\core\__init__.py", line 4, in <module> from .sympify import sympify, SympifyError File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\core\sympify.py", line 9, in <module> from sympy.core.random import choice File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\core\random.py", line 25, in <module> from sympy.utilities.iterables import is_sequence File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\utilities\__init__.py", line 4, in <module> from .iterables import (flatten, group, take, subsets, File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\utilities\iterables.py", line 18, in <module> from sympy.utilities.decorator import deprecated File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\utilities\decorator.py", line 8, in <module> from sympy.testing.runtests import DependencyError, SymPyDocTests, PyTestReporter File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\testing\__init__.py", line 3, in <module> from .runtests import test, doctest File "D:\Anaconda\envs\pythonproject\lib\site-packages\sympy\testing\runtests.py", line 20, in <module> import pdb File "D:\Anaconda\envs\pythonproject\lib\pdb.py", line 74, in <module> import cmd File "D:\Anaconda\envs\pythonproject\lib\cmd.py", line 50, in <module> IDENTCHARS = string.ascii_letters + string.digits + '_' AttributeError: module 'string' has no attribute 'ascii_letters'这是什么错误
时间: 2023-07-17 19:55:28 浏览: 137
anaconda中python文件
这个错误是因为在cmd.py文件中,使用了string.ascii_letters,但是在string模块中并没有定义ascii_letters属性。这可能是因为你的Python版本过低,建议升级到Python 3.x版本。另外你的代码中使用到了Sympy库,也可能是因为Sympy库版本过低导致的错误,你可以尝试升级Sympy库。
阅读全文