删除所有以前版本的python
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33033747/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Remove all previous versions of python
提问by solalito
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).
我有一些使用C++
and 的经验Fortran
,我想开始使用python
我的后处理,因为我开始意识到MATLAB
我需要做的事情是多么低效(主要涉及具有数百万个点的图)。
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
安装了几个版本,每次我想开始使用。现在已经变得一团糟。在 中/usr/local/bin/
,这是命令ls python*
返回的内容:
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
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).
我现在想要一个干净的石板。我想要一种安全的方法来删除所有以前版本的python
,包括它们的所有包,这样我就可以安装最新版本numpy
并matplotlib
顺利导入我想要的所有库(我遇到了一些问题)。
EDIT:
编辑:
I am running on OSX Yosemite 10.10.
我在 OSX Yosemite 10.10 上运行。
采纳答案by Peque
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!).
不要卸载系统的 Python 解释器(最有可能是 Python 2.7)。您可能会考虑卸载其他版本(最有可能是 Python 3.5),但我认为您真的不需要这样做(保留系统范围的 Python 3 解释器可能不是一个坏主意......谁知道!)。
If you want a clean state I would recommend you to use virtual environments for now on. You have two options:
如果你想要一个干净的状态,我建议你现在使用虚拟环境。您有两个选择:
- Use
virtualenv
andpip
to setup your virtual environments and packages. However, usingpip
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).
- 使用
virtualenv
和pip
来设置您的虚拟环境和包。然而,使用pip
意味着你将有编译软件包需要汇编(numpy
,matplotlib
等多家科研Python包,你可以用你的“后处理”)。 - 使用 Conda (或Miniconda)。通过这种方式,您将能够处理虚拟环境,而无需自己编译 Python 包。Conda 还允许您处理不同的 Python 解释器,而无需将它们安装在您的系统中(它会为您下载它们)。
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.
此外,您说您觉得 MATLAB 在绘制数百万个点方面效率低下。我不知道您的实际需求/约束,但我发现 Matplotlib 在绘制大数据和/或实时数据时效率非常低。
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).
作为建议,请考虑使用PyQtGraph。如果您仍然觉得这还不够快,请考虑使用 VisPy(目前可能功能较少/不方便,但效率更高)。