setuptools

Distributing python application tutorials

安稳与你 提交于 2020-03-05 14:14:38
问题 Hi as a python newbie I have written a small python application that can convert an excel worksheet into a sqlite database table. Its not a terribly complex application but it does make use of external modules/package like xlrd (http://pypi.python.org/pypi/xlrd) which I had to download and install when writing my app. Now that is all done I would like to distribute it amongst my friends, all windows users, while they have python on their machines, they may or may not have the xlrd modules. I

Equivalent for `--find-links` in `setup.py`

我与影子孤独终老i 提交于 2020-03-05 03:22:23
问题 What is the equivalent of --find-links / -f flag for pip in setup.py . I know dependency_links exist, but that requires pointing to a specific file, I want something similar to -f that can point to a list of links from which the package can be selected based on version&os. 回答1: In a setuptools context the dependency_links option should do what you need. According to setuptools documentation, this option accepts: the URLs of web pages that contain direct download links for example: setuptools

python虚拟环境模块venv

我们两清 提交于 2020-03-02 21:02:50
相信只要学习python的同学对于虚拟环境这个概念肯定不会太陌生,虚拟环境指的是一个个单独隔离的python开发环境。各个虚拟环境之间互不干扰,都有自己独立的开发包。就像是在电脑上装了很多个虚拟机,每个虚拟机里面你随便折腾,不会影响到物理机,也不会影响到其他虚拟机。 既然这么有用,那么Python里面用来创建虚拟环境的模块virtualenv是怎么使用的呢?我们一起来看一下。 virtualenv基本命令格式 这个模块比较简单,它只有一条命令,但是跟的选项比较多,就是通过不同的选项来控制生成不同的虚拟环境。我们先来简单看一下它的基本命令格式: virtualenv [--version] [--with-traceback] [-v | -q] [--app-data APP_DATA] [--clear-app-data] [--discovery {builtin}] [-p py] [--creator {builtin,cpython3-win,venv}] [--seeder {app-data,pip}] [--no-seed] [--activators comma_sep_list][--clear] [--system-site-packages] [--copies] [--download | --no-download] [--extra-search

python---egg包的一些知识

♀尐吖头ヾ 提交于 2020-03-02 05:32:33
经常接触Python的同学可能会注意到,当需要安装第三方python包时,可能会用到easy_install命令。easy_install是由PEAK(Python Enterprise Application Kit)开发的setuptools包里带的一个命令,它用来安装egg包。egg包是目前最流行的python应用打包部署方式。如何制作和安装egg包?下面我就简单的分析了一下。 1.1 安装setuptools 首先要安装setuptools工具。Debian/Ubuntu下可以直接使用apt安装:: $ sudo apt-get install python-setuptools 手工安装的话,有两种方式: 通过引导程序 ez_setup.py 来安装。这个引导程序会联网下载最新版本setuptools来安装,同时也可以更新本地的setuptools。 $ wget http://peak.telecommunity.com/dist/ez_setup.py $ sudo python ez_setup.py 更新setuptools:: $ sudo python ez_setup.py -U setuptools 或者下载setuptools的egg包来安装。可以在 这里 查看最新版本下载。下载完毕以后通过sh安装。 $ wget http://pypi.python

打包python程序,得到自己的egg

自作多情 提交于 2020-03-02 05:03:09
经常接触Python的同学可能会注意到,当需要安装第三方python包时,可能会用到easy_install命令。easy_install是由PEAK(Python Enterprise Application Kit)开发的setuptools包里带的一个命令,它用来安装egg包。egg包是目前最流行的python应用打包部署方式。如何制作和安装egg包?下面我就简单的分析了一下。 1.1 安装setuptools 首先要安装setuptools工具。Debian/Ubuntu下可以直接使用apt安装:: $ sudo apt-get install python-setuptools 手工安装的话,有两种方式: 通过引导程序 ez_setup.py 来安装。这个引导程序会联网下载最新版本setuptools来安装,同时也可以更新本地的setuptools。 $ wget http://peak.telecommunity.com/dist/ez_setup.py $ sudo python ez_setup.py 更新setuptools:: $ sudo python ez_setup.py -U setuptools 或者下载setuptools的egg包来安装。可以在 这里 查看最新版本下载。下载完毕以后通过sh安装。 $ wget http://pypi.python

setuptools, easy_install, and a custom pypi server

落花浮王杯 提交于 2020-02-27 05:27:05
问题 I've got a custom pypi server running and am wondering how to point all references to https://pypi.python.org/ from there to my custom server? I want to be able to cover cases of a user calling pip / easy_install of a package (so they don't have to remember to do -i or -f ) as well as someone doing python setup.py install using setuptools with install_requires in the setup.py . Is there some global config or setting I can do to get all these different methods to look at my local server? I

Python Namespace Packages in Python3

こ雲淡風輕ζ 提交于 2020-02-26 11:12:57
问题 The topic of namespace packages seems a bit confusing for the uninitiated, and it doesn't help that prior versions of Python have implemented it in a few different ways or that a lot of the Q&A on StackOverflow are dated. I am looking for a solution in Python 3.5 or later . The scenario: I'm in the process of refactoring a bunch of Python code into modules and submodules, and working to get each of these projects set up to operate independently of each other while sitting in the same

Python Namespace Packages in Python3

情到浓时终转凉″ 提交于 2020-02-26 11:12:33
问题 The topic of namespace packages seems a bit confusing for the uninitiated, and it doesn't help that prior versions of Python have implemented it in a few different ways or that a lot of the Q&A on StackOverflow are dated. I am looking for a solution in Python 3.5 or later . The scenario: I'm in the process of refactoring a bunch of Python code into modules and submodules, and working to get each of these projects set up to operate independently of each other while sitting in the same

pip安装使用出现ImportError: No module named setuptools

最后都变了- 提交于 2020-02-26 05:36:56
安装后运行到:python setup.py install出现错误,如下: [root@localhost pip-18.0]# python setup.py install Traceback (most recent call last): File “setup.py”, line 6, in from setuptools import setup, find_packages ImportError: No module named setuptools 解决方法 1.下载: 在它的官网可以下载到安装包: https://pypi.python.org/pypi/setuptools 下载路径: #wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-12.0.3.tar.gz#md5=f07e4b0f4c1c9368fcd980d888b29a65 2. 安装 # tar xvf setuptools-12.0.3.tar.gz # cd setuptools=12.0.3 # python setup.py install # cd pip-18.0 # python setup.py install 来源: 51CTO 作者:

How to print warnings and errors when using setuptools (pip)

蓝咒 提交于 2020-02-24 00:47:40
问题 I am using setuptools to package code such that it can be easily installed using cd project_name && pip install . During the setup process, I want to warn the user about pre-existing config files and print some post install instructions on the system. For example /etc/project_name/project.conf exists. Not copying default config file. I have tried to use print and logging.warning() but still the warnings don't appear when installing using pip. I have a feeling I am missing something obvious.