我运行Ubuntu 9:10,安装了一个名为M2Crypto的包(版本为0.19.1)。我需要下载、构建和安装最新版本的M2Crypto包(0.20.2)。

0.19.1包的文件位于多个位置,包括(/usr/share/ pshared和/usr/lib/pymodules.python2.6)。

在安装0.20.2之前,如何从系统中完全卸载0.19.1版本?


当前回答

通过windows命令提示符执行:pip list——expired 您将得到过期包的列表。 执行命令pip install [package]——upgrade 它将升级[包]和卸载以前的版本。


更新pip:

py -m pip install --upgrade pip

同样,这将卸载以前版本的pip,并安装最新版本的pip。

其他回答

在Juptyer笔记本上,一个很简单的方法就是

!pip install <package_name> --upgrade

因此,您只需要替换为实际的包名。

通过windows命令提示符执行:pip list——expired 您将得到过期包的列表。 执行命令pip install [package]——upgrade 它将升级[包]和卸载以前的版本。


更新pip:

py -m pip install --upgrade pip

同样,这将卸载以前版本的pip,并安装最新版本的pip。

我如何从我的系统完全卸载版本0.19.1之前 安装0.20.2吗?

以卸载M2Crypto使用

pip uninstall M2Crypto

我需要下载,建立和安装最新版本的 M2Crypto包(0.20.2)。

为了安装最新版本,可以使用PyPi

pip install M2Crypto 

要安装版本20.2(过时的版本),请运行

pip install M2Crypto==0.20.2

假设一个人只是想升级

pip install M2Crypto --upgrade # Or pip install M2Crypto -U

注:

Depending on one's Python version (here's how to find the version) one may use a different pip command. Let's say one is working with Python 3.7, instead of just using pip, one might use pip3.7. Using sudo is considered unsafe. Nowadays there are better practices to manage the development system, such as: virtual environments or development containers. The development containers allow one to put the entire development environment (be it modules, VS Code extensions, npm libraries,...) inside a Docker container. When the project comes to an end, one closes the container. There's no need to keep all of those requirements around in the computer for no reason. If you feel like reading more about it: Visual Studio Docs, Github.

pip install -U $(pip list --outdated | awk 'NR>2 {print $1}')

例如:

python -m pip install --proxy <proxyserver_name>:<port#> <pkg_name> 

记住,在设置变量后导出变量,使它们可用于外壳会话。

窗口:

添加到环境变量:

set HTTP_PROXY=<proxyserver_name>:<port#>

你可能必须先安装完整的python包