setuptools

How to have PyPI package install header files for C extension with distutils/setuptools?

主宰稳场 提交于 2019-12-06 01:07:32
We have a package (rebound) up on PyPI that includes a C extension . The relevant part of the setup.py file looks like this (simplified): libreboundmodule = Extension('librebound', sources = [ 'src/rebound.c'], include_dirs = ['src'],) Additional libraries need access to rebound.h, but when one runs pip install rebound it doesn't install rebound.h anywhere. How can we get distutils/setuptools to install rebound.h somewhere along with all the python modules? We're hoping that we can have pip install rebound do all the work so the user doesn't have to run any additional commands. 来源: https:/

Setuptools not passing arguments for entry_points

牧云@^-^@ 提交于 2019-12-06 00:41:22
问题 I'm using setuptools for a Python script I wrote After installing, I do: $ megazord -i input -d database -v xx-xx -w yy-yy Like I would if I was running it ./like_this However, I get: Traceback (most recent call last): File "/usr/local/bin/megazord", line 9, in <module> load_entry_point('megazord==1.0.0', 'console_scripts', 'megazord')() TypeError: main() takes exactly 1 argument (0 given) Which looks like setuptools is not sending my arguments to main() to be parsed (by optparse) Here's my

【Ubuntu报错】ModuleNotFoundError: No module named 'setuptools'

霸气de小男生 提交于 2019-12-05 21:40:43
报错信息 python安装插件时报错: 解决方案 这个是因为没有找到模型,需要安装setuptools。 解决方案点击如下链接进入: Python3中setuptools安装详解 :https://blog.csdn.net/shuiyixin/article/details/89532087 等待安装完成就可以啦。 来源: CSDN 作者: 水亦心 链接: https://blog.csdn.net/shuiyixin/article/details/89532335

Python安装模块出错(No module named setuptools)解决方法

戏子无情 提交于 2019-12-05 21:39:11
Python第三方模块中一般会自带setup.py文件,在Windows环境下,我们只需要在命令行中使用以下命令即可自动化安装 python setup.py install 安装的过程中有可能会出现“ImportError: No module named setuptools”的错误提示,这是因为Windows环境下Python默认是没有安装setuptools这个模块的,这也是一个第三方模块。 只需要下载 https://bootstrap.pypa.io/ez_setup.py 自动化安装脚本,并运行即可自动判别python版本进行自动化安装,之后再运行 python setup.py install 即可自动安装第三方模块了 *运行脚本时,卡在下载setuptools的步骤的话,可以事先在下载好在运行脚本 #!/usr/bin/env python """ Setuptools bootstrapping installer. Maintained at https://github.com/pypa/setuptools/tree/bootstrap. Run this script to install or upgrade setuptools. This method is DEPRECATED. Check https://github.com/pypa

How to prevent setuptools install package as an .egg

跟風遠走 提交于 2019-12-05 21:01:46
问题 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 ? 回答1: I've discovered that python setup.py install --old-and-unmanageable does the job,

TypeError: dist must be a Distribution instance

笑着哭i 提交于 2019-12-05 19:20:19
问题 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

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

瘦欲@ 提交于 2019-12-05 19:14:52
问题 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

Why does installing a python package break setuptools and causes pkg_resources to not be found?

本秂侑毒 提交于 2019-12-05 17:08:59
This is partly a question, partly my own findings on what I found to be the issue when I encountered this error: (cdbak)USER-MBP-2:.virtualenvs <YOUR_USER_NAME>$ pip Traceback (most recent call last): File "/Users/<YOUR_USER_NAME>/.virtualenvs/cdbak/bin/pip", line 6, in <module> from pkg_resources import load_entry_point ImportError: No module named pkg_resources This issue arose when I tried to install pypsum via pip in my virtual environment for use with django. (cdbak)USER-MBP-2:.virtualenvs <YOUR_USER_NAME>$ pip install pypsum I have been working in virtual environments, so I was fortunate

How do you specify the shebang line of a command script created by setuptools

无人久伴 提交于 2019-12-05 16:18:58
I have created a package that I will be distributing throughout the company that replaces a legacy bash script with the same name. It is referenced many places so it needs to execute like the current script does. This has worked fine until I encountered some servers that do not have a current version of Python as the default Python (aka CentOS). Is there a way to specify in the setup.py what shebang line is created at the top of the script file? i.e. I need #!/opt/bin/python rather than #!/usr/bin/env python . Run the script with /opt/bin/python script.py , or edit the first line to read #!

Install package with separate source directory in editable mode

冷暖自知 提交于 2019-12-05 16:16:40
Situation This is the structure of an example package: $ tree Foo/ Foo/ ├── setup.py └── src ├── bar.py └── __init__.py The package's name shall be foo however the package's source files are placed in the src folder. The files' contents are: setup.py: from setuptools import setup setup( name='foo', version='1', packages=['foo'], package_dir={'foo': 'src'} ) __init__.py: from .bar import bar print(bar) bar.py: bar = 1 Problem When doing pip install Foo everything is fine and I can use the package as I'd expect: >>> import foo 1 However when I install the package in editable mode ( pip install