distutils

pypi UserWarning: Unknown distribution option: 'install_requires'

允我心安 提交于 2019-11-29 20:47:35
Does anybody encounter this warning when executing python setup.py install of a PyPI package? install_requires defines what the package requires. A lot of PyPI packages have this option. How can it be an "unknown distribution option"? Sebastian Blask python setup.py uses distutils which doesn't support install_requires. setuptools does, also distribute (its successor), and pip (which uses either) do. But you actually have to use them. I.e. call setuptools through the easy_install command or pip install . Another way is to import setup from setuptools in your setup.py, but this not standard and

How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?

試著忘記壹切 提交于 2019-11-29 20:27:42
The Twisted Plugin System is the preferred way to write extensible twisted applications. However, due to the way the plugin system is structured (plugins go into a twisted/plugins directory which should not be a Python package), writing a proper setup.py for installing those plugins appears to be non-trivial. I've seen some attempts that add 'twisted.plugins' to the 'packages' key of the distutils setup command, but since it is not really a package, bad things happen (for example, an __init__.py is helpfully added by some tools). Other attempts seem to use 'package_data' instead (eg, http:/

setuptools vs. distutils: why is distutils still a thing?

一个人想着一个人 提交于 2019-11-29 18:49:56
Python has a confusing history of tools that can be used to package and describe projects: these include distutils in the Standard Library, distribute , distutils2 , and setuptools (and maybe more). It appears that distribute and distutils2 were discontinued in favor of setuptools , which leaves two competing standards. To my understanding setuptools offers far more options (e.g. declaring dependencies, tests, etc.) than distutils , however it is not included in the Python standard library (yet?). The Python Packaging User Guide [ 1 ] recommends now: Use setuptools to define projects and

How does one overwrite the default compile flags for Cython when building with distutils?

我的未来我决定 提交于 2019-11-29 17:34:34
问题 I am compiling some cython extensions in linux and noticed that it defaults to using -O2 when building from the distutils mechanism. I was wondering if there was a simple way to change that to a -O3. I have tried using the extra_compile_args on Extension objects, but that leads to both -O2 and -O3 being passed as arguments to gcc. I kind of want to play with other esoteric gcc options and thus am hoping I can just control the compilation step. An obvious question is "why don't I just run

PyCrypto install error on Windows

两盒软妹~` 提交于 2019-11-29 17:05:25
问题 I am trying to install PyCrypto 2.6 Library on my computer. But I keep getting the following error D:\Software\Python\package\pycrypto-2.6>python setup.py build running build running build_py running build_ext warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. building 'Crypto.Random.OSRNG.winrandom' extension error: Unable to find vcvarsall.bat My System has Windows 8 Pro 64-bit, Visual Studio Enterprise 2012 and Python 3.3 To fix the error I tried to set the

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

牧云@^-^@ 提交于 2019-11-29 10:57:50
问题 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

Distutils compiler options configuration

…衆ロ難τιáo~ 提交于 2019-11-29 10:24:22
Maybe a stupid question, but I was wondering where Python's distutils get the compiler options from? It gets some linked directories wrong and I want to correct that once and for all. I know there should be a prefix/lib/pythonver/distutils/distutils.cfg but I can't find any distutils.cfg anywhere on the computer. Obviously I haven't got a local setup.cfg or any $HOME/.pydistutils.cfg. I'm using the Enthought 64-bit distribution, version 7.3 (Python 2.7) on Mac OS X 10.8.3 Cheers, U. I actually export them to the environment, just like for autotools' configure: export CC=/usr/local/bin/clang

Cross Compiling Python Extensions

眉间皱痕 提交于 2019-11-29 05:58:50
I have a problem cross compiling netifaces extension under Buildroot Linux distro for ARM (Python 2.7.2). According to this blog http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/ I've defined CC, LDSHARE etc. environment variables, but distutils/setuptools doesn't take CC into account so all tests will fail: running build Setting prefix Setting prefix running build_ext checking for getifaddrs... not found. (cached) checking for getnameinfo... not found. (cached) checking for socket IOCTLs... not found. (cached) checking for optional header files... netash/ash.h

f2py with Intel Fortran compiler

冷暖自知 提交于 2019-11-29 04:35:16
I am trying to use f2py to interface my python programs with my Fortran modules. I am on a Win7 platform. I use latest Anaconda 64 (1.7) as a Python+NumPy stack. My Fortran compiler is the latest Intel Fortran compiler 64 (version 14.0.0.103 Build 20130728). I have been experiencing a number of issues when executing f2py -c -m PyModule FortranModule.f90 --fcompiler=intelvem The last one, which I can't seem to sort out is that it looks like the sequence of flags f2py/distutils passes to the compiler does not match what ifort expects. I get a series of warning messages regarding unknown options

Package only binary compiled .so files of a python library compiled with Cython

匆匆过客 提交于 2019-11-29 02:06:51
I have a package named mypack which inside has a module mymod.py , and the __init__.py . For some reason that is not in debate, I need to package this module compiled (nor .py or .pyc files are allowed). That is, the __init__.py is the only source file allowed in the distributed compressed file. The folder structure is: . │ ├── mypack │ ├── __init__.py │ └── mymod.py ├── setup.py I find that Cython is able to do this, by converting each .py file in a .so library that can be directly imported with python. The question is: how the setup.py file must be in order to allow an easy packaging and