Python 虚拟环境中的扩展问题
Python problem with extensions in virtual enviroment
我正在使用 python 3.7.5 版本,但是我为特定项目下载了 3.6 版本并创建了虚拟环境,安装了所需的扩展(numpy、matplotlib...)。但是,当我尝试 运行 python 脚本时,会出现很多与扩展相关的错误。该代码与 python 的 3.7 版本完美配合。有什么想法可能是错误的吗?
File "c:/Users/zabul/OneDrive/Desktop/pyCode/Data_observation.py", line 4, in <module>
import pandas as pd
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-packages\pandas\__init__.py",
line 55, in <module>
from pandas.core.api import (
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-packages\pandas\core\api.py",
line 24, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\core\groupby\__init__.py", line 1, in <module>
from pandas.core.groupby.generic import ( # noqa: F401
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\core\groupby\generic.py", line 44, in <module>
from pandas.core.frame import DataFrame
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-packages\pandas\core\frame.py",
line 115, in <module>
from pandas.core.series import Series
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\core\series.py", line 84, in <module>
import pandas.plotting
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\plotting\__init__.py", line 59, in <module>
from pandas.plotting._core import (
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\plotting\_core.py", line 17, in <module>
import pandas.plotting._matplotlib # noqa
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\plotting\_matplotlib\__init__.py", line 3, in <module>
from pandas.plotting._matplotlib.boxplot import (
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\plotting\_matplotlib\boxplot.py", line 4, in <module>
from matplotlib.artist import setp
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\matplotlib\__init__.py", line 128, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\matplotlib\rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\matplotlib\fontconfig_pattern.py", line 26, in <module>
from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pyparsing\__init__.py", line 130, in <module>
__version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'
这个主题与这个主题相同。你的错误似乎是在 pyparsing 上。
我正在使用 python 3.7.5 版本,但是我为特定项目下载了 3.6 版本并创建了虚拟环境,安装了所需的扩展(numpy、matplotlib...)。但是,当我尝试 运行 python 脚本时,会出现很多与扩展相关的错误。该代码与 python 的 3.7 版本完美配合。有什么想法可能是错误的吗?
File "c:/Users/zabul/OneDrive/Desktop/pyCode/Data_observation.py", line 4, in <module>
import pandas as pd
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-packages\pandas\__init__.py",
line 55, in <module>
from pandas.core.api import (
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-packages\pandas\core\api.py",
line 24, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\core\groupby\__init__.py", line 1, in <module>
from pandas.core.groupby.generic import ( # noqa: F401
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\core\groupby\generic.py", line 44, in <module>
from pandas.core.frame import DataFrame
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-packages\pandas\core\frame.py",
line 115, in <module>
from pandas.core.series import Series
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\core\series.py", line 84, in <module>
import pandas.plotting
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\plotting\__init__.py", line 59, in <module>
from pandas.plotting._core import (
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\plotting\_core.py", line 17, in <module>
import pandas.plotting._matplotlib # noqa
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\plotting\_matplotlib\__init__.py", line 3, in <module>
from pandas.plotting._matplotlib.boxplot import (
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pandas\plotting\_matplotlib\boxplot.py", line 4, in <module>
from matplotlib.artist import setp
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\matplotlib\__init__.py", line 128, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\matplotlib\rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\matplotlib\fontconfig_pattern.py", line 26, in <module>
from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
File "C:\Users\zabul\OneDrive\Desktop\pyCode\.virtenv\lib\site-
packages\pyparsing\__init__.py", line 130, in <module>
__version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'
这个主题