删除所有以前版本的python [英] Remove all previous versions of python

查看:63
本文介绍了删除所有以前版本的python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 C++Fortran 有一些经验,我想开始使用 python 进行后期处理,因为我开始意识到 MATLAB 对于我需要做的事情是多么低效(主要涉及具有数百万个点的图).

I have some experience with C++ and Fortran, and I want to start using python for my post-processing as I am starting to realise how inefficient MATLAB is for what I need to do (mostly involves plots with millions of points).

我已经安装了几个版本的 python,每次我想开始使用时.现在已经变得一团糟.在 /usr/local/bin/ 中,这是命令 ls python* 返回的内容:

I already had a few versions of python installed, from every time I wanted to start using. It has now become a mess. In /usr/local/bin/, here is what the command ls python* returns:

python            python2.7         python3           python3.5         python3.5m        pythonw-32
python-32         python2.7-32      python3-32        python3.5-32      python3.5m-config pythonw2.7 
python-config     python2.7-config  python3-config    python3.5-config  pythonw           pythonw2.7-32

我现在想要一个干净的石板.我想要一种安全的方法来删除所有以前版本的 python,包括它们的所有包,这样我就可以安装最新版本并导入我想要的所有库,例如 numpymatplotlib 顺利(我遇到了一些问题).

I now want a clean slate. I want a safe way to remove all the previous versions of python, including all of their packages, so I can just install the latest version and import all the libraries I want like numpy and matplotlib smoothly (I had some issues with that).

我在 OSX Yosemite 10.10 上运行.

I am running on OSX Yosemite 10.10.

推荐答案

不要卸载系统的 Python 解释器(最有可能是 Python 2.7).您可能会考虑卸载其他版本(最有可能是 Python 3.5),但我认为您真的不需要这样做(保留系统范围的 Python 3 解释器可能不是一个坏主意......谁知道!).

Do not uninstall your system's Python interpreter (Python 2.7 most probably). You might consider uninstalling the other version (Python 3.5 most probably), but I do not think you really need to do that (it may not be a bad idea to keep a system-wide Python 3 interpreter... who knows!).

如果你想要一个干净的状态,我建议你现在使用虚拟环境.您有两个选择:

If you want a clean state I would recommend you to use virtual environments for now on. You have two options:

  • 使用 virtualenvpip 来设置你的虚拟环境和包.但是,使用 pip 意味着您必须编译需要编译的包(numpymatplotlib 和许多其他可能使用的科学 Python 包用于您的后处理").
  • 使用 Conda(或 Miniconda).通过这种方式,您将能够处理虚拟环境,但不必自己编译 Python 包.Conda 还允许您处理不同的 Python 解释器,而无需需要在您的系统中安装它们(它将下载他们给你).
  • Use virtualenv and pip to setup your virtual environments and packages. However, using pip means you will have to compile the packages that need compilation (numpy, matplotlib and many other scientific Python packages that you may use for your "post-processing").
  • Use Conda (or Miniconda). This way you will be able to handle virtual environments but without having to compile Python packages yourself. Conda also allows you to handle different Python interpreters without the need of having them installed in your system (it will download them for you).

此外,您说您觉得 MATLAB 在绘制数百万个点方面效率低下.我不知道您的实际需求/限制,但我发现 Matplotlib 在绘制大数据和/或实时数据时效率非常低.

Also, you say you are feeling MATLAB is inefficient for plotting millions of points. I do not know your actual needs/constraints, but I find Matplotlib to be very inefficient for plotting large data and/or real-time data.

作为建议,请考虑使用 PyQtGraph.如果您仍然觉得这还不够快,请考虑使用 VisPy(目前可能功能较少/不方便,但效率更高).

Just as a suggestion, consider using PyQtGraph. If you still feel that is not fast enough, consider using VisPy (probably less functional/convenient at the moment, but more efficient).

这篇关于删除所有以前版本的python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆