相关疑难解决方法(0)

为Python安装pip,virtualenv和分发的正确方法是什么?

简短的问题

背景

问题4314376的回答中,我建议使用,ez_setup以便您可以安装pipvirtualenv如下:

curl -O http://peak.telecommunity.com/dist/ez_setup.py
sudo python ez_setup.py
sudo easy_install pip
sudo pip install virtualenv
Run Code Online (Sandbox Code Playgroud)

我最初是从Jesse Noller的博客文章中提取这些说明的,所以你想在Mac上使用Python?.我喜欢保持一个干净的全局site-packages目录的想法,所以我安装的唯一其他软件包就是 virtualenvwrapperdistribute.(distribute由于这个Python公共服务公告,我最近添加到了我的工具箱.为了安装这两个软件包,我使用了:

sudo pip install virtualenvwrapper
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
Run Code Online (Sandbox Code Playgroud)

没有更多的setuptools和easy_install

要真正遵循Python公共服务公告,在全新的Python安装上,我会执行以下操作:

curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
sudo easy_install pip
sudo pip install virtualenv
sudo pip install virtualenvwrapper
Run Code Online (Sandbox Code Playgroud)

雕文的Rebuke

在一个评论我的回答 …

python setuptools virtualenv distribute

245
推荐指数
7
解决办法
15万
查看次数

当PyPi显示版本1.0.0时,为什么pip安装matplotlib版本0.91.1?

2012年10月15日更新

PyPi现在在1.1.0显示matplotlib所以这个问题已经解决了.通过以下方式安装matplotlib:

pip install matplotlib

以下是过时的信息

PyPi显示了matplotlib 1.0.0.但是,当我通过pip将matplotlib安装到virtualenv时,安装了版本0.91.1.

  • 为什么版本不同?
  • 有没有办法pip install matplotlib 1.0.0?

研究

似乎matplotlib在PyPi上的DOAP记录指向了正确的版本.以下是DOAP记录供参考:

<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>matplotlib</name>
<shortdesc>Python plotting package</shortdesc>
<description>matplotlib strives to produce publication quality 2D graphics
      for interactive graphing, scientific publishing, user interface
      development and web application servers targeting multiple user
      interfaces and hardcopy output formats.  There is a 'pylab' mode
      which emulates matlab graphics</description>
<download-page>https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0</download-page>
<homepage rdf:resource="http://matplotlib.sourceforge.net" />
<maintainer><foaf:Person><foaf:name>John D. Hunter</foaf:name>
<foaf:mbox_sha1sum>4b099b4a7f50a1f39642ce59c2053c00d4de6416</foaf:mbox_sha1sum></foaf:Person></maintainer> …
Run Code Online (Sandbox Code Playgroud)

python pip matplotlib pypi

26
推荐指数
3
解决办法
9352
查看次数

使用'pip |部署Python软件包的任何方法 easyinstall'+'* .pyc only'+'flat名称空间包装'+ virtualenv?

目标:

  • 利用现代的Python打包工具集将专有程序包部署/安装到某些virtualenv中。
  • 安装的软件包应仅包含已编译的* .pyc(或* .pyo),而不包含源文件。
  • 有几个软件包,并且使用供应商名称(此处为Studio 选择dgmx)作为软件包名称。因此,安装的软件包将类似于dgmx / alucarddgmx / bansheedgmx / carmilla,...
  • 已安装软件包的文件层次结构应类似于python setup.py install --single-version-externally-managedpip install。请参阅为什么我无法通过手动* python setup.py install *获得准确的结果到* pip install *?

简短的问题:

我喜欢仅通过已编译的* .pyc(或* .pyo)文件将专有的命名空间包部署到virtualenv中,其中文件/目录层次结构只是通过许多ooxx.egg路径污染sys.path来反映名称空间。

我尝试过的东西:

  1. python setup.py bdist_egg --exclude-source-files然后easy_install ooxx.egg
    • 为每个名称空间包污染“ sys.path”。
  2. python setup.py install --single-version-externally-managed
    • 不只是* .pyc。
    • “ install_requires”被忽略了!
    • 需要手动放置ooxx.egg-info / installed-files.txt才能使卸载正常进行。
  3. pip install . 在“ setup.py”的位置。
    • 不只是* .pyc。 …

python packaging setuptools virtualenv

5
推荐指数
1
解决办法
1923
查看次数

使用pypi安装最新的matplotlib版本

在某种程度上,这个问题已被问到......所以接受我的道歉......

我想从这里安装最新版本的matplotlib:http: //pypi.python.org/pypi/matplotlib/1.0.1

我知道我可以下载它,解压缩并编译它,但我要将它安装在许多机器上,而pip应该是一种幸福.

所以,我做了easy_install pip,这里是我用两种工具得到的输出:

$ sudo easy_install "matplotlib==1.0.1"

install_dir /usr/local/lib/python2.6/dist-packages/
Searching for matplotlib==1.0.1
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.sourceforge.net
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/
Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/
No local packages or download links found for matplotlib==1.0.1
error: Could not find suitable distribution for Requirement.parse('matplotlib==1.0.1')
Run Code Online (Sandbox Code Playgroud)

或者用pip:

$ pip install matplotlib==1.0.1
Downloading/unpacking matplotlib==1.0.1
  Could not find a version that satisfies the requirement matplotlib==1.0.1 (from versions: )
No distributions matching the version for …
Run Code Online (Sandbox Code Playgroud)

pip matplotlib easy-install

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