distutils

Python cx_freeze 4.3.4: Setting targetName causes errors

半世苍凉 提交于 2019-12-08 00:21:52
问题 I am very new to cx_freeze and I am trying to understand it a bit better, I have this setup.py file: import sys from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need fine tuning. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]} setup( name = "guifoo", version = "0.1", description = "My GUI application!", options = {"build_exe": build_exe_options}, executables = [Executable("mypy.py", base="Console", targetName="hello")]) which if

Trying to build the basic python extension example fails (windows)

瘦欲@ 提交于 2019-12-07 21:35:37
问题 I have Python 2.6 and Visual Studio 2008 running on a Win7 x64 machine. When I try to build the basic python extension example in c "example_nt" as found in the python 2.6 sources distribution, it fails: python setup.py build And this results in: running build running build_ext building 'aspell' extension Traceback (most recent call last): File "setup.py", line 7, in <module> ext_modules = [module1]) File "C:\Python26\lib\distutils\core.py", line 152, in setup dist.run_commands() File "C:

py2exe ImportError: no module named <package I have impemented>

半城伤御伤魂 提交于 2019-12-07 11:45:27
问题 I have implemented a package names myUtils, it consists of folder 'myUtils', file ' init .py' and a number of *.py files with names != 'myUtils'. This package is included in myOtherProject.py and can be found/used when I run them from Eclipse. However, when I run py2exe on myOtherProject.py, resulting exe cannot find this module(error message "ImportError: no module named myUtils"). Trimmed version of my setup.exe: from distutils.core import setup import py2exe, sys sys.path.append(pathTo

Dynamically Linking Python Extension (.pyd) to Another Extension

ぃ、小莉子 提交于 2019-12-07 11:37:12
问题 Python Extension modules are just dynamic libraries, so I assume it's possible to dynamically link a Python extension to another. The problem is on Windows Python Extensions are are given the .pyd extension instead of .dll , so I can't get distutils to link to them when I run the setup script. (I don't think this is a problem on UNIX because Python extensions use the .so file extension.) Assume I have an extension bar.pyd which needs to link to foo.pyd . Basically, what I did in the setup

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

无人久伴 提交于 2019-12-07 10:56:51
问题 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

Using distutils where swig interface file is in src folder

╄→гoц情女王★ 提交于 2019-12-07 10:49:02
问题 I've got a setup.py that looks something like this: from setuptools import setup, Extension import glob sources = glob.glob('src/*.cpp') + glob.glob('src/*.i') # this is ugly, but otherwise I get the wrapper included twice sources = [source for source in sources if '_wrap' not in source] setup( name = 'engine', ext_modules = [ Extension( '_engine', sources = sources, swig_opts = ['-c++'], include_dirs = ['src'] ) ], py_modules = ['engine'] package_dir = {'' : 'src'} ) Now this works as long

How to override python's distutils gcc linker with icc?

爱⌒轻易说出口 提交于 2019-12-07 08:47:49
问题 I was able to successfully build cython on Ubuntu 14.04 from source as explained in this SE question/answer Compiling cython From source with icc and I downloaded the source code from here - Cython source code download. The command to compile cython is CC=icc LINKCC=icc python3.4 setup.py build I am enclosing the build log. It is STILL using gcc for linking. Here is a sample of build log. It appears CC=icc LINKCC=icc does NOT seem to change the linker to icc. It is still using x86_64-linux

How do I get setup.py test to use a specific fortran compiler?

自闭症网瘾萝莉.ら 提交于 2019-12-07 03:52:24
问题 I am trying to test a package that includes some f90 files. If I build or install and specify the fortran compiler, it works fine. However, when I try to test I get the following error: C:\Users\jsalvatier\workspace\scikits.bvp_solver>python setup.py config_fc --fcompiler=gfortran test running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running test running egg_info running build_src build_src building extension "scikits.bvp_solver.bvp

Python does not consider distutils.cfg

六月ゝ 毕业季﹏ 提交于 2019-12-07 02:46:40
问题 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.

Can I use an alternative build system for my Python extension module (written in C++)?

痞子三分冷 提交于 2019-12-07 02:37:31
While distutils works alright, I'm not entirely comfortable with it, and I also have performance problems with no apparent solution . Is it possible to integrate Premake or cmake in my setup.py script so that python setup.py build calls them and then places the output where install expects it? I figured out a way, it's not pretty but it works. Here is a summation of my setup.py script file - it should be fairly self explanatory: import shutil import os from distutils.core import setup from distutils.core import Extension from distutils.command.build_ext import build_ext from distutils.command