distutils

Is it possible to include subdirectories using dist utils (setup.py) as part of package data?

孤街浪徒 提交于 2019-11-30 17:13:40
Basically my python package is setup like: module \_examples \_folder1 \_file1.py \_file2.py \_folder2 \_file1.py \_file2.py Basically I want to just use: package_data = { 'module': ['examples/*'], }, because my project always has people adding examples and I want it to be easy to list them from within my application. I can get it work for any FILE within examples, but not re-curse down through sub-directories. Is this possible? defermat I believe what you're looking for is something like this for you setup.py , which will recursively find any packages in the project, also be sure and include

What is the graft command in Python's MANIFEST.in file?

荒凉一梦 提交于 2019-11-30 16:27:36
问题 I found a Python project with a MANIFEST.in file. I can guess at the meaning of much of it, but I am unclear on the meaning of the line: graft tools 回答1: You can see such a file in JoshData/pdfminer/MANIFEST.in or openstack/deb-python-falcon/MANIFEST.in for instance. It is a python project which uses the MANIFEST.in template A MANIFEST.in file can be added in a project to define the list of files to include in the distribution built by the sdist command. When sdist is run, it will look for

python pip package install fails , dllwrap error after 'fixing': “unable to find vcvarsall.bat”

前提是你 提交于 2019-11-30 16:04:43
问题 I can't find this in the archives. Is there something not right with mingw/msys? [I need to get vcvarsall.bat fixed, so I can install other packages.] Failure to install python package 'twisted' using pip.exe. I have python2.6 and mingw/msys installed. %PATH% includes C:\MinGW\ and C:\MinGW\mingw32\bin first: pip.exe install twisted fails by saying error: Unable to find vcvarsall.bat I create file G:\Programs (x86)\Python 2.6\Lib\distutils\distutils.cfg , which contains: [build] compiler

Install two python modules with same name

隐身守侯 提交于 2019-11-30 14:17:47
What's the best way to install two python modules with the same name? I currently depend on two different facebook libraries: pyfacebook and Facebook's new python-sdk. Both of these libraries install themselves as the module 'facebook'. I can think of a bunch of hacky solutions but before I go an hack away I was curious if there was a pythonic way of dealing with this situation. I'm using virtualenv and pip. (Yes, I will eventually deprecate one of them, but I had two different engineers working on two different problems and they didn't realize that they were using a different module until

Cython and fortran - how to compile together without f2py

戏子无情 提交于 2019-11-30 13:55:58
问题 FINAL UPDATE This question is about how to write a setup.py that will compile a cython module which accesses FORTRAN code directly, like C would. It was a rather long and arduous journey to the solution, but the full mess is included below for context. ORIGINAL QUESTION I have an extension which is a Cython file, which sets up some heap memory and passes it to the fortran code, and a fortran file, which is a venerable old module that I'd like to avoid reimplementing if I can. The .pyx file

Python runtime_library_dirs doesn't work on Mac

≡放荡痞女 提交于 2019-11-30 13:04:22
问题 I have a Python extension module that needs to link against some dynamic libraries at runtime, so I need to tell it where to look for them. I'm doing this by specifying runtime_library_dirs in my setup.py. This works fine on Linux, but seems to have no effect on Mac. I get an ImportError when I try to import my module, and the only way I've found to make it go away is to add the library directory to DYLD_LIBRARY_PATH before starting python. What do I need to do to make this work? 回答1: I

PyCrypto install error on Windows

强颜欢笑 提交于 2019-11-30 11:31:35
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 Environment Variable VS90COMNTOOLS=%VS110COMNTOOLS% as advised by fmuecke in the post error: Unable to

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

旧时模样 提交于 2019-11-30 11:31:13
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 cython my.pyx and compile the results manually?". I would love to, is my answer... but the cython

Error when trying to cross-compile SWIG Python extension for mingw32 using distutils

 ̄綄美尐妖づ 提交于 2019-11-30 10:49:09
I am trying to cross-compile a simple SWIG Python extension on Linux for Windows (mingw32), using the distutils module. The ultimate goal is to compile a Python wrapper for some library and being able to use it on Windows. Obviously I started with the most basic example and unfortunately it fails. Here are the files I am using: example.c /* File : example.c */ /* A global variable */ double Foo = 3.0; /* Compute the greatest common divisor of positive integers */ int gcd(int x, int y) { int g; g = y; while (x > 0) { g = x; x = y % x; y = g; } return g; } example.i - SWIG interface file /* File

Confused about the package_dir and packages settings in setup.py

无人久伴 提交于 2019-11-30 08:15:33
Here is my project directory structure, which includes the project folder, plus a "framework" folder containing packages and modules shared amongst several projects which resides at the same level in the hierarchy as the project folders: -------------------------------------------------------------- Framework/ package1/ __init__.py mod1.py mod2.py package2/ __init__.py moda.py modb.py My_Project/ src/ main_package/ __init__.py main_module.py setup.py README.txt -------------------------------------------------------------- Here is a partial listing of the contents of my setup.py file: --------