相关疑难解决方法(0)

apt-get 安装 vs pip 安装

对于下载python包时必须使用上述命令的情况,我有点困惑。我试图根据这个问题的答案下载一个名为 pyudev 的包。我执行了这个命令:

sudo pip install python-pyudev
Run Code Online (Sandbox Code Playgroud)

但收到以下消息:

Downloading/unpacking python-pyudev

  Could not find any downloads that satisfy the requirement python-pyudev
Cleaning up...
No distributions at all found for python-pyudev
Storing complete log in /home/vineet/.pip/pip.log
Run Code Online (Sandbox Code Playgroud)

但是以下工作正常:

sudo apt-get install python-pyudev
Run Code Online (Sandbox Code Playgroud)

什么时候apt-get应该用于安装包,什么时候python-pip使用?

python apt software-installation pip

121
推荐指数
4
解决办法
11万
查看次数

easy_install/pip 或 apt-get

Rails 上的 Ubuntu wiki 页面所述,建议使用 gems 管理您的 Rails/Ruby 依赖项。

像 Django 这样的 Python 包的最佳实践是什么?我应该通过 apt-get 安装它们还是应该让 easy_install/pip 从 PyPi 获取它们?

python apt

30
推荐指数
2
解决办法
1万
查看次数

当 apt 安装的软件包也存在时,使用 pip3 安装的 python 3 软件包?

我在/usr/lib/python3/dist-packages(通过apt)中安装了numpy 1.8.2,在/usr/local/lib/python3.4/dist-packages(通过点)。两个路径都在 sys.path 中(按这个顺序),但只有旧的 apt 版本在 python3 中被导入。

?  ~  sudo pip3 install --upgrade numpy
[sudo] password for naught101: 
Real name of requirement numpy is numpy
Requirement already up-to-date: numpy in /usr/local/lib/python3.4/dist-packages
Cleaning up...
?  ~  ipython3
Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
Type "copyright", "credits" or "license" for more information.

IPython 1.2.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details …
Run Code Online (Sandbox Code Playgroud)

package-management python apt pip

6
推荐指数
1
解决办法
4303
查看次数