如何在 Windows 上的 Python 3 中安装 Matplotlib
Matplotlib tell us that the requirement is Python 2.4 or later but not Python3.
Now I'm working with Python3 and I need some plot from Matplotlib.
So how do I solve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
抱歉,目前不支持。
如果您有勇气,可以尝试使用 Py3k SVN 分支据报道,可以使用一个简单的例子。请注意,过去 8 个月没有任何更新。
当然,如果可以的话,我们非常欢迎您为 Python 3 的移植做出贡献。
I'm sorry, but at the current time it's not supported.
If you feel brave, you can try with the Py3k SVN branch which reportedly works with a simple example. Be aware that there has been no update in the last 8 months on this though.
Of course, you'd be more than welcome to contribute to the porting to Python 3 if you could.
你可以尝试一下非官方版本。检查此网站:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
You could try the unofficial versions. Check this site:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
查看链接上的文档,它显示以下内容是依赖项:
Python (>= 2.7 或 >= 3.4)
您可以下载可在以下位置运行的 Python 版本:
https://www.python.org/downloads/windows/
我会使用最新版本和 64 位版本作为某些库用于数据分析的数据不能在 32 位版本的 Python 上运行。
您下载的 Python 版本将附带
pip
,然后您可以使用它来安装工作所需的任何库。如果您想从命令行或 bash 终端运行程序,请确保您已设置环境变量。
我通过 bash 终端安装了 matplotlib:
让我知道这是否有帮助。
Looking at the docs at the link it says the following is a dependency:
Python (>= 2.7 or >= 3.4)
You can download a version of Python that will work at:
https://www.python.org/downloads/windows/
I would go with the most recent release and a 64 bit version as certain libraries for data analysis do not run on the 32 bit version of Python.
The version of Python you download will come with
pip
which you can then use to install any libraries you need to do your work.Make sure you have set your environment variables if you want to run your programs from the command line or bash terminal.
I installed matplotlib through the bash terminal with:
Let me know if that helps.
在Visual Studio 2022中,只需使用“解决方案资源管理器”来安装Matplotlib。
现在 Matplotlib应该安装在Visual Studio Python环境上!
注意,如果选择的 Python 环境是:
然后 Matplotlib 将安装在您的默认 Visual Studio 上
Python 环境,
然后 Matplotlib 将安装在您当前的项目中。
In Visual Studio 2022 just use the "Solution Explorer" to install Matplotlib.
Now Matplotlib should be installed on the Visual Studio Python environment!
Note that if the chosen Python environment is:
Then Matplotlib will be installed on your default Visual Studio
Python environment,
Then Matplotlib will JUST be installed on your current project.
要在 Windows 上安装 matplotlib,首先,您必须先安装 pip 要在 Windows 上安装 pip,请访问网站
https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip
下载 get-pip。 py,请小心将其保存为 .py 文件而不是 .txt。然后,从命令提示符运行它:
如果已经安装了 pip,请通过在命令提示符中写入来安装 matplotlib:
To install matplotlib on windows, first, you have to install pip first to install pip on windows go to website
https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip
Download get-pip.py, being careful to save it as a .py file rather than .txt. Then, run it from the command prompt:
if pip is already installed, install matplotlib by writing in command prompt: