distutils

Python distutils gcc path

℡╲_俬逩灬. 提交于 2019-12-05 23:52:58
问题 I'm trying to cross-compile the pycrypto package, and I'm getting closer and closer however, I've hit an issue I just can't figure out. I want distutils to use the cross-compile specific gcc- so I set the CC env var and it seems to respect the setting for the first invocation of the compiler, but thats it. export CC="/opt/teeos/buildroot/output/host/usr/bin/i586-linux-gcc" /opt/teeos/buildroot/output/host/usr/bin/i586-linux-gcc -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std

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

Compiling an optional cython extension only when possible in setup.py

大兔子大兔子 提交于 2019-12-05 16:59:31
I have a python module fully implemented in python. (For portability reasons.) The implementation of a small part has been duplicated in a cython module. To improve perfomance where possible. I know how to install the .c modules created by cython with distutils . However if a machine has no compiler installed, I suspect the setup will fail even though the module is still usable in pure python mode. Is there a way to compile the .c module if possible but fail gracefully and install without it if compiling is not possible? I guess you will have to make some modification both in your setup.py and

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

python的packages管理

房东的猫 提交于 2019-12-05 14:43:15
一、概念介绍 Python is known for it's “batteries included” philosophy and has a rich standard library。However, being a popular language, the number of third party packages is much larger than the number of standard library packages. So it eventually becomes necessary to discover how packages are used, found and created in Python. 目前python提供的包管理工具有多个,其关系如下: 具体可以参见: http://guide.python-distribute.org/introduction.html 可以看出,Distribute代替了Setuptools, 但将来会被distutils2取代,并作为标准库的一部分。 关于packages的管理,则由pip进行 有关packages的发布,查找的网站是: https://pypi.python.org/pypi Distribute是对标准库disutils模块的增强,disutils主要是用来更加容易的打包和分发包

setup.py not installing data files

这一生的挚爱 提交于 2019-12-05 13:20:15
问题 I have a Python library that, in addition to regular Python modules, has some data files that need to go in /usr/local/lib/python2.7/dist-package/mylibrary. Unfortunately, I have been unable to convince setup.py to actually install the data files there. Note that this behaviour is under install - not sdist. Here is a slightly redacted version of setup.py module_list = list_of_files setup(name ='Modules', version ='1.33.7', description ='My Sweet Module', author ='PN', author_email ='email',

Rename script file in distutils

三世轮回 提交于 2019-12-05 12:41:07
问题 I have a python script, myscript.py, which I wish to install using distutils: from distutils.core import setup setup(..., scripts=['myscript.py'], ...) I'd prefer if I could call the installed script using just myscript instead of typing myscript.py . This could be accomplished by renaming the file to just myscript but then a lot of editors etc. would no longer understand that it is a Python file. Is there some way to keep the old name, myscript.py but still install the file as myscript ? 回答1

distutils ignores changes to setup.py when building an extension?

时间秒杀一切 提交于 2019-12-05 08:57:40
I have a setup.py file that builds an extension. If I change one of the source files, distutils recognizes this and rebuilds the extension, showing all the compile / link commands. However, if the only thing I change is setup.py (I'm fiddling trying to make library dependencies work), then it doesn't seem to rebuild (e.g., none of the compile/link commands show up). I've tested this by removing one of the source files in the line sources = ['foo.c', 'bar.c' ...] and when I pip install -e . or python setup.py install , it still creates a new file for the extension, but it must be a version

Python does not consider distutils.cfg

 ̄綄美尐妖づ 提交于 2019-12-05 06:43:37
I have tried everything given and the tutorials all point in the same direction about using mingw as a compiler in python instead of visual c++. I do have visual c++ and mingw both. Problem started coming when I wanted to install using pip. It always gave Unable to find vcvarsall.bat So as per suggestions I created a file distutils.cfg under the following path c:/python27/Lib/distutils/ and added the following two lines: [build] compiler=mingw32 However, this file has no effect whatsoever. The same error still exists while using pip. I am trying to install numpy by the way currently although