Can I install Python windows packages into virtualenvs?

Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects' dependencies aren't all thrown together into a common pile. But if I want to install a package on Windows that's packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I have pycuda-0.94rc.win32-py2.6.exe. When I run it, it examines the

我可以将Python窗口包安装到virtualenvs中吗?

Virtualenv非常棒:它允许我保留大量不同的Python安装,以便不同项目的依赖不会全部放在一起。 但是,如果我想在Windows上安装打包成.exe安装程序的软件包,我该如何指导它安装到virtualenv中? 例如,我有pycuda-0.94rc.win32-py2.6.exe。 当我运行它时,它会检查注册表,并且只能找到一个要安装的Python26,这是我的virtualenv基于的一个常见问题。 我怎样才能将它安装到virtualenv中? 是的你可以。 所有你需要的是

install to vcvarsall.bat?

I already have MSVC++ 2010 Express installed, and my vcvarsall.bat file is at C:Program FilesMicrosoft Visual Studio 10.0VC , which is in my system PATH. When I run easy_install , it can't find vcvarsall.bat. Is there something I need to set in my distutils.cfg file to point it to my MSVC++ installation? G:>easy_install hg-git install_dir C:Python26Libsite-packages Searching for hg-git

安装到vcvarsall.bat?

我已经安装了MSVC ++ 2010 Express,并且我的vcvarsall.bat文件位于C:Program FilesMicrosoft Visual Studio 10.0VC ,该文件位于我的系统PATH中。 当我运行easy_install ,找不到vcvarsall.bat。 有什么我需要在我的distutils.cfg文件中设置指向我的MSVC ++安装? G:>easy_install hg-git install_dir C:Python26Libsite-packages Searching for hg-git Best match: hg-git 0.2.6 Processing hg_git-0.2.6-py2.6.egg hg-g

Building lxml for Python 2.7 on Windows

I am trying to build lxml for Python 2.7 on Windows 64 bit machine. I couldn't find lxml egg for Python 2.7 version. So I am compiling it from sources. I am following instructions on this site http://lxml.de/build.html under static linking section. I am getting error C:Documents and SettingsAdministratorDesktoplxmlpackagelxml-2.2.6lxml-2.2. 6>python setup.py bdist_wininst --static

在Windows上为Python 2.7构建lxml

我正在尝试在Windows 64位机器上为Python 2.7构建lxml。 我找不到Python 2.7版本的lxml egg。 所以我从源头上编译它。 我正在按照此网站上的说明操作 http://lxml.de/build.html 在静态链接部分。 我收到错误 C:Documents and SettingsAdministratorDesktoplxmlpackagelxml-2.2.6lxml-2.2. 6>python setup.py bdist_wininst --static Building lxml version 2.2.6. NOTE: Trying to build without Cython, pre-genera

How to write a Python module/package?

I've been making Python scripts for simple tasks at work and never really bothered packaging them for others to use. Now I have been assigned to make a Python wrapper for a REST API. I have absolutely no idea on how to start and I need help. What I have: (Just want to be specific as possible) I have the virtualenv ready, it's also up in github, the .gitignore file for python is ther

如何编写Python模块/包?

我一直在为工作中的简单任务制作Python脚本,并且从来没有真正困扰他人打包供其他人使用。 现在我已经被分配到一个REST API的Python包装器。 我完全不知道如何开始,我需要帮助。 我拥有的: (只想尽可能具体)我准备好了virtualenv,它也在github中,python的.gitignore文件也存在,此外还有用于与REST API交互的请求库。 而已。 这是当前的目录树 . ├── bin │   └── /the usual stuff/ ├── include │   └── /the usu

Python package to manage module system in HPCs

I'm working in an HPC environment which uses the module system for software-version management. I'm using python for the automation of the installation of a certain software which requires some dependencies. Do you know if there exists any python package/module to manage the module system? (list available modules, load/unload modules, read modulefiles, etc). I could'n find anythi

Python软件包来管理HPC中的模块系统

我正在使用模块系统进行软件版本管理的HPC环境中工作。 我使用python来自动安装某个需要一些依赖的软件。 你知道是否存在任何用于管理模块系统的python软件包/模块? (列出可用模块,加载/卸载模块,读取模块文件等)。 我无法找到类似的东西。 看看easybuild。 它旨在自动安装科学软件,并处理模块文件,以便您可以在那里找到有趣的模式/线索。

How can I get a list of locally installed Python modules?

I would like to get a list of Python modules, which are in my Python installation (UNIX server). How can you get a list of Python modules installed in your computer? Solution My 50 cents for getting a pip freeze -like list from a Python script: import pip installed_packages = pip.get_installed_distributions() installed_packages_list = sorted(["%s==%s" % (i.key, i.version) for i in ins

我如何获得本地安装的Python模块列表?

我想获取Python模块的列表,这些模块位于我的Python安装(UNIX服务器)中。 如何获得计算机中安装的Python模块列表? 解 我从一个Python脚本中获得一个类似pip freeze列表的50美分: import pip installed_packages = pip.get_installed_distributions() installed_packages_list = sorted(["%s==%s" % (i.key, i.version) for i in installed_packages]) print(installed_packages_list) 作为(太长)一个班轮: s

What is a clean, pythonic way to have multiple constructors in Python?

I can't find a definitive answer for this. AFAIK, you can't have multiple __init__ functions in a Python class. So how do I solve this problem? Suppose I have an class called Cheese with the number_of_holes property. How can I have two ways of creating cheese-objects... one that takes a number of holes like this: parmesan = Cheese(num_holes = 15) and one that takes no arguments a

在Python中有多个构造函数的干净,pythonic方法是什么?

我无法为此找到明确的答案。 AFAIK,在Python类中不能有多个__init__函数。 那么我该如何解决这个问题呢? 假设我有一个名为Cheese的类,它具有number_of_holes属性。 我怎么能有两种方法来创建奶酪对象...... 一个需要像这样的一些洞: parmesan = Cheese(num_holes = 15) 以及不带任何参数并随机化number_of_holes属性的方法: gouda = Cheese() 我只能想到一种方法来做到这一点,但这似乎有点笨拙: class Cheese(

How to list all functions in a Python module?

I have a python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it. I want to call the doc function on each one. In ruby I can do something like ClassName.methods to get a list of all the methods available on that class. Is there something similar in python? eg. something like: from somemodule import foo print foo.methods #

如何列出Python模块中的所有函数?

我在我的系统上安装了一个python模块,我希望能够看到其中可用的函数/类/方法。 我想调用每个文档的功能。 在ruby中,我可以做类似ClassName.methods的东西来获得该类上所有可用方法的列表。 python中有类似的东西吗? 例如。 就像是: from somemodule import foo print foo.methods # or whatever is the correct method to call 检查模块。 另请参阅pydoc模块,交互式解释器中的help()函数和生成pydoc文档的pydoc命

What is the most compatible way to install python modules on a Mac?

I'm starting to learn python and loving it. I work on a Mac mainly as well as Linux. I'm finding that on Linux (Ubuntu 9.04 mostly) when I install a python module using apt-get it works fine. I can import it with no trouble. On the Mac, I'm used to using Macports to install all the Unixy stuff. However, I'm finding that most of the python modules I install with it are not be

什么是在Mac上安装python模块最兼容的方式?

我开始学习python并热爱它。 我主要在Mac上工作,也在Linux上工作。 我发现在Linux上(主要是Ubuntu 9.04),当我使用apt-get安装python模块时,它工作正常。 我可以毫不费力地导入它。 在Mac上,我习惯于使用Macports来安装所有Unixy的东西。 但是,我发现我安装的大多数python模块都没有被python看到。 我花了一些时间玩弄PATH设置并使用python_select。 没有什么是真正的工作,在这一点上,我不是很了解,而是我只是

How to use a pull request in my local copy of a Git branch?

I'm not familiar with Git, I only know how to download a master or dev branch of a python software project from Github and install into my system (I do not really use Git locally). Now there is a "pull request" by a GitHub user which contains a feature I find useful but not in the main or dev branch. How can I use that in my local copy? And if I manage to include it into my loc

如何在我的本地Git分支副本中使用拉取请求?

我不熟悉Git,我只知道如何从Github下载python软件项目的master或dev分支,并将其安装到我的系统中(我并不真正在本地使用Git)。 现在有一个GitHub用户的“pull请求”,其中包含一个我觉得有用的功能,但不包含在main或dev分支中。 我怎样才能在我的本地副本中使用它? 如果我设法将它包含在本地副本中,如果我稍后更新到最新的maaster / dev分支,它会丢失吗? 请参阅:Git获取远程分支git fetch git checkout <the na