【发布时间】:2022-01-04 13:32:21
【问题描述】:
我将 Python 3.6.5 64 位与适用于我的 Anaconda 一起使用。 目前,我需要将 LabView 连接到 Python。据我了解,LabView 支持 Python 3.6 版本,python 和 LabView 的位数必须相同。我已经在我的 Windows(64 位)上安装了 LabView 32 位,因为即使我们有 Windows 64,他们也建议安装 LabView 32 位。
所以,我安装了 Python 3.6.0 32 位,然后通过使用 python shell 我制作了一个简单的代码,导入 numpy 模块并将其连接到 LabView,我可以工作了。 但是,当我编写需要导入matplotlib的代码时,它在python shell中出现了版本错误:
AttributeError: 'version_info' object has no attribute '__version__'
所以,我无法将它与 LabView 集成。
当我安装模块(pip、matplotlib 和...)时,我将路径更改为:"C:\Users\user\AppData\Local\Programs\Python\Python36-32\Scripts>"
然后写道:pip install numpy 和 pip install matplotlib。安装它们时没有错误,但是当我想通过 python shell 运行一个简单的代码时,它无法导入 matplotlib。我也通过 pip install matplotlib==version number 尝试了旧版本的 matplotlib,但它没有解决问题。
另一方面,在 anaconda 64 位中一切正常。
你能帮我解决这个问题吗?
【问题讨论】:
-
我更新了我的答案
-
我的回答对你有用吗?
-
@john-hen 新版本的 python 对我来说很适合 Anaconda,但我必须使用旧版本的 Python 将其与 LabView 集成(并且与 LabView 集成的位数应该相同。所以我必须使用 Python 3.6-32 位)。
-
@john-hen 非常感谢。它解决了我的问题。我安装了 Python 3.6.5 32 位(与 Anaconda 相同,激活的 python 是 3.6.5 32 位)。安装后我不需要通过 pip 一个一个地安装包;因为我之前在 Anaconda 中安装过它们。然后轻松地将它们导入 Python shell。
-
K你能接受答案吗
标签: python matplotlib pip anaconda labview