setuptools

Programmatically detect system-proxy settings on Windows XP with Python

匆匆过客 提交于 2019-11-30 14:27:20
问题 I develop a critical application used by a multi-national company. Users in offices all around the globe need to be able to install this application. The application is actually a plugin to Excel and we have an automatic installer based on Setuptools' easy_install that ensures that all a project's dependancies are automatically installed or updated any time a user switches on their Excel. It all works very elegantly as users are seldom aware of all the installation which occurs entirely in

Install two python modules with same name

隐身守侯 提交于 2019-11-30 14:17:47
What's the best way to install two python modules with the same name? I currently depend on two different facebook libraries: pyfacebook and Facebook's new python-sdk. Both of these libraries install themselves as the module 'facebook'. I can think of a bunch of hacky solutions but before I go an hack away I was curious if there was a pythonic way of dealing with this situation. I'm using virtualenv and pip. (Yes, I will eventually deprecate one of them, but I had two different engineers working on two different problems and they didn't realize that they were using a different module until

How to package a Python daemon with setuptools

泪湿孤枕 提交于 2019-11-30 13:43:33
How do you package a Python app with setuptools so that when it's installed (e.g. via setup.py or pip), it places a daemon script in the appropriate location, starts it, and marks it to automatically start at boot time? In my case, my code only works with Linux, so I only care about installing the daemon in Linux environments (specifically Ubuntu). I've found several posts describing how to easily create Python daemons, but I can't seem to find anything describing how you'd install them in a production environment so that they'd be treated as any other normal daemon or service. I know Ubuntu

PyCharm does not recognize modules installed in development mode

孤街醉人 提交于 2019-11-30 11:48:41
问题 I have two pure python projects in PyCharm 3.4.1 Professional Edition. The first one, let's call it p (like package), is structured as a setuptools package (i.e. with setup.py, all requirements etc., however it is not uploaded to pypi or any other online repository). The second one, let's call it s (like script), is just a python script along with two modules. Project s is (in PyCharm) configured to use a dedicated virtualenv, let's call it venv . The problem I have is the following: when I

Change default dist folder with setuptools

风流意气都作罢 提交于 2019-11-30 08:38:55
I'm using setuptools 0.6 to package my code. By default when I type python setup.py sdist , the tool creates a folder dist directly in the same folder of my script. What I can do to change this default folder? Edit: Another question is, if my setup script and my package folder are not in the same folder, what can I do to specify the exact path of the package? Thanks Use the --dist-dir=[differentdir] option. From python setup.py sdist --help : --dist-dir (-d) directory to put the source distribution archive(s) in [default: dist] You can specify the top-level package directory with the package

installing only .pyc (python compiled) with setuptools

删除回忆录丶 提交于 2019-11-30 08:33:57
I want to run python setup.py install (the setup script uses setuptools), and I want only the .pyc files to be included in the resulting egg or directory. all .py files must not be present. How can I do this ? not with install , but a possibility is to run the following command python setup.py bdist_egg --exclude-source-files and install the resulting egg in dist with easy_install easy_install dist/eggname.egg Note that according to the manual install is nothing but a shortcut to easy_install use. 来源: https://stackoverflow.com/questions/5730686/installing-only-pyc-python-compiled-with

Windows下python3安装pip管理包

泪湿孤枕 提交于 2019-11-30 08:10:06
方法有两种: 请参考:http://www.pip-installer.org/en/latest/installing.html#prerequisites 1. 通过setuptools安装 安装setuptools,下载 https://pypi.python.org/pypi/setuptools setuptools-X.X.tar.gz cd setuptools-x.x python setup.py install 之后python安装目录下会生成一个Script文件夹,文件夹里会生成easy_install相关文件 cd Scirpt easy_install pip 或者不通过easy_install来安装pip,可以通过get-pip.py来安装 下载 https://raw.github.com/pypa/pip/master/contrib/get-pip.py python get-pip.py 或者也不通过get-pip来安装pip,而是通过pip源码来安装 下载 https://pypi.python.org/packages/source/p/pip pip-X.X.tar.gz cd pip-x.x python setup.py install 最后通过pip来安装distribute pip install distribute 2.通过

How to install Python 2.7 and Python 3.3 on CentOS

╄→尐↘猪︶ㄣ 提交于 2019-11-30 08:08:51
In this guide I will show you how to install Python 2.7 and 3.3 on CentOS 6. The examples below are for Python 2.7.6 and Python 3.3.5, but the procedure is the same for any modern version of Python including the upcoming Python 3.4.0. I make regular updates to this guide to track new versions. Please see the end of the document for a changelog. CentOS 6 ships with Python 2.6.6 and several critical system utilities, for example yum , will break if the default Python interpreter is upgraded. The trick is to install new versions of Python in /usr/local (or some other non-standard location) so

How can I make setuptools install a package from another source that's also available on pypi with the same version number?

こ雲淡風輕ζ 提交于 2019-11-30 08:03:39
It's a similar question to How can I make setuptools install a package that's not on PyPI? but not the same. As I would like to use the forked version of some package, setuptools ignore the dependency link (as it has the same version number). Is there a way to force using the link from the dependency_links? Or is the only way to change the version number in the forked repo? requires = [ ... 'pyScss==1.1.3' ... dependencies = [ 'https://github.com/nadavshatz/pyScss/zipball/master#egg=pyScss-1.1.3' ] Update Weird, apparently it works if this package is the only one in the required list, that is

Python setuptools: how to include a config file for distribution into <prefix>/etc

喜夏-厌秋 提交于 2019-11-30 07:54:06
How can I write setup.py so that: The binary egg distribution ( bdist_egg ) includes a sample configuration file and Upon installation puts it into the {prefix}/etc directory? A sample project source directory looks like this: bin/ myapp etc/ myapp.cfg myapp/ __init__.py [...] setup.py The setup.py looks like this: from distutils.command.install_data import install_data packages = ['myapp', ] scripts = ['bin/myapp',] cmdclasses = {'install_data': install_data} data_files = [('etc', ['etc/myapp.cfg'])] setup_args = { 'name': 'MyApp', 'version': '0.1', 'packages': packages, 'cmdclass':