setuptools

Installing my sdist from PyPI puts the files in unexpected places

梦想与她 提交于 2019-12-04 04:44:04
My problem is that when I upload my Python package to PyPI, and then install it from there using pip, my app breaks because it installs my files into completely different locations than when I simply install the exact same package from a local sdist. Installing from the local sdist puts files on my system like this: /Python27/ Lib/ site-packages/ gloopy-0.1.alpha-py2.7.egg/ (egg and install info files) data/ (images and shader source) doc/ (html) examples/ (.py scripts that use the library) gloopy/ (source) This is much as I'd expect, and works fine (e.g. my source can find my data dir,

Add a dll/so to a python built distribution

大憨熊 提交于 2019-12-04 04:17:51
I've compiled the python wrapper of nanomsg and I want to create a python installer for the package. The package can be created by running python setup.py bdist --format=wininst However I would like nanomsg.dll/nanomsg.so to be included in the installer/package but I haven't found any documentation regarding this issue. Shleimeleh As stated in the documentation here one needs to add the following code to his setup.py script: setup( name='nanomsg', version=__version__, packages=[str('nanomsg'), str('_nanomsg_ctypes'), str('nanomsg_wrappers')], data_files=[('lib\\site-packages\\',["C:\\Dev\

How to prevent setuptools install package as an .egg

谁说我不能喝 提交于 2019-12-04 03:35:24
For example, installing IPython on Linux (where setuptools is not installed) I've got IPython installed in site-packages\IPython . Installing IPython on Windows (where IPython requires setuptools), after executing the same command python setup.py install I get IPython installed in site-packages\ipython-0.13.2-py2.7.egg\IPython Is there a way to install the module "old way" i.e. into site-packages\IPython ? I've discovered that python setup.py install --old-and-unmanageable does the job, but I am not sure it is a good way as --old-and-unmanageable is marked "Try not to use this!". I don't know

Create launchable GUI script from Python setuptools (without console window!)

家住魔仙堡 提交于 2019-12-04 02:55:26
The way I currently add an executable for my Python-based GUI is this: setup( # ... entry_points = {"gui_scripts" : ['frontend = myfrontendmodule.launcher:main']}, # ... ) On Windows, this will create "frontend.exe" and "frontend-script.pyw" in Python's scripts folder (using Python 2.6). When I execute the EXE file, a console window is shown but the PYW file works correctly without showing one. So my question is: How can I make the EXE file execute the program without the console window? The solution should work on Linux, too (don't suggest py2exe ;). Alright, I investigated a bit in the

TypeError: dist must be a Distribution instance

半世苍凉 提交于 2019-12-04 02:42:31
My package depends on BeautifulSoup. If I install my package in a fresh virtualenv via python setup.py develop , I get the following error. If I execute python setup.py develop a second time, everything seems to work fine. I have no idea, what's happening. How to fix it to get a reproducable setup? Best match: beautifulsoup4 4.3.2 Downloading https://pypi.python.org/packages/source/b/beautifulsoup4/beautifulsoup4-4.3.2.tar.gz#md5=b8d157a204d56512a4cc196e53e7d8ee Processing beautifulsoup4-4.3.2.tar.gz Writing /tmp/easy_install-1eBfi3/beautifulsoup4-4.3.2/setup.cfg Running beautifulsoup4-4.3.2

What is the alternative to using --process-dependency-links with pip

安稳与你 提交于 2019-12-04 01:45:36
I am using Python 2.7. I am trying to pip install a repo (on internal github) that has a dependency on another repo (also on internal github). I tried several options but the one that worked was like this: (env)abc$ cat requirements.txt -e git://github.abc.com/abc/abc.git#egg=my_abc --process-dependency-links (env)abc$ pip install -r requirements.txt But I got a warning while running the command line that said: "DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release." I am on pip v7.1.2. What is the right way to do this? You can use PEP 508 URL

How do I forbid easy_install from zipping eggs?

↘锁芯ラ 提交于 2019-12-04 01:43:07
What must I put into distutils.cfg to prevent easy_install from ever installing a zipped egg? The compression is a nice thought, but I like to be able to grep through and debug that code. I pulled in some dependencies with python setup.py develop . A closer look reveals that also accepts the --always-unzip flag. It would just be nice to set that as default. the option is zip-ok, so put the following in your distutils.cfg: [easy_install] # i don't like having zipped files. zip_ok = 0 I doubt there is a setting in distutils.cfg for this, as easy_install is not a part of distutils. But run easy

安装Ansible

ぃ、小莉子 提交于 2019-12-03 23:50:40
安装Ansible 安装Ansible 从项目的checkout中可以很容易运行Ansible,Ansible的运行不要求root权限,也不依赖于其他软件,不要求运行后台进程, 也不需要设置数据库.因此我们社区的许多用户一直使用Ansible的开发版本,这样可以利用最新的功能特性,也方便对项目做贡献. 因为不需要安装任何东西,跟进Ansible的开发版相对于其他开源项目要容易很多. 从源码安装的步骤: cd /opt/ yum -y python3 git wget https://files.pythonhosted.org/packages/11/0a/7f13ef5cd932a107cd4c0f3ebc9d831d9b78e1a0e8c98a098ca17b1d7d97/setuptools-41.6.0.zip unzip setuptools-41.6.0.zip cd setuptools-41.6.0/ python setup.py build python setup.py install easy_install pip pip install ansible ansible git clone git://github.com/ansible/ansible.git --recursive cd ./ansible source ./hacking/env

setuptools: adding additional files outside package

戏子无情 提交于 2019-12-03 22:59:53
I have a python application that has a fixed layout which I cannot change. I would like to wrap it up using setuptools, e.g. write a setup.py script. Using the official documentation, I was able to write a first template. However, the application in question uses a lot of additional data files that are not explicitly part of any package. Here's an example source tree: somepackage __init__.py something.py data.txt additionalstuff moredata.txt INFO.txt Here's the trouble: The code in something.py reads the files moredata.txt and INFO.txt . For the former, I can monkeypatch the problem by adding

Python any of many dependencies

≯℡__Kan透↙ 提交于 2019-12-03 16:48:33
问题 From time to time I come across a situation where I have a package that can depend on either package A or B. For example, my project depends on a package called spam , if this project is renamed to pyspam , my project can either depend on spam or pyspam . I cannot figure out (or find) how I would define such dependencies in setup.py. What is a commonly accepted way to solve this? EDIT: I would like to define the dependencies in setup.py . Something like this: from setuptools import setup