distutils

Can cython be compiled with icc?

*爱你&永不变心* 提交于 2019-12-19 08:29:50
问题 I am trying to build cython from source with icc compiler on Ubuntu 14.04 as my python is compiled with Intel icc compiler. When I tried to install cython using pip3 install cython and then ran cython I got following error Traceback (most recent call last): File "/usr/local/bin/cython", line 9, in <module> load_entry_point('Cython==0.24', 'console_scripts', 'cython')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load

Install two python modules with same name

[亡魂溺海] 提交于 2019-12-18 17:00:50
问题 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

Accessing data files before and after distutils/setuptools

 ̄綄美尐妖づ 提交于 2019-12-18 15:29:24
问题 I'm doing a platform independent PyQt application. I intend to use write a setup.py files using setuptools. So far I've managed to detech platform, e.g. load specific options for setup() depending on platform in order to use py2exe on Windows... etc... However, with my application I'm distributing some themes, HTML and images, I need to load these images in the application at runtime. So far they are stored in the themes/ directory of the application. I've been reading documentation on

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

你离开我真会死。 提交于 2019-12-18 13:36:49
问题 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

Python “setup.py develop”: is it possible to create “.egg-info” folder not in source code folder?

∥☆過路亽.° 提交于 2019-12-18 13:01:36
问题 Python has ability to "pseudoinstall" a package by running it's setup.py script with develop instead of install . This modifies python environment so package can be imported from it's current location (it's not copied into site-package directory). This allows to develop packages that are used by other packages: source code is modified in place and changes are available to rest of python code via simple import . All works fine except that setup.py develop command creates an .egg-info folder

Python “setup.py develop”: is it possible to create “.egg-info” folder not in source code folder?

余生颓废 提交于 2019-12-18 13:01:08
问题 Python has ability to "pseudoinstall" a package by running it's setup.py script with develop instead of install . This modifies python environment so package can be imported from it's current location (it's not copied into site-package directory). This allows to develop packages that are used by other packages: source code is modified in place and changes are available to rest of python code via simple import . All works fine except that setup.py develop command creates an .egg-info folder

How to add package data recursively in Python setup.py?

允我心安 提交于 2019-12-18 10:55:10
问题 I have a new library that has to include a lot of subfolders of small datafiles, and I'm trying to add them as package data. Imagine I have my library as so: library - foo.py - bar.py data subfolderA subfolderA1 subfolderA2 subfolderB subfolderB1 ... I want to add all of the data in all of the subfolders through setup.py, but it seems like I manually have to go into every single subfolder (there are 100 or so) and add an init .py file. Furthermore, will setup.py find these files recursively,

Shared library dependencies with distutils

ぃ、小莉子 提交于 2019-12-18 10:54:32
问题 I'm a newbie to distutils and I have a problem that really has me stuck. I am compiling a package that requires an extension, so I make the extension thus: a_module = Extension( "amodule", ["initmodule.cpp"], library_dirs=libdirs, extra_objects = [ "unix/x86_64/lib/liba.so" "unix/x86_64/lib/lib.so", "unix/x86_64/lib/libc.so"], ) I then run the setup method: setup(name="apackage", version="7.2", package_dir = {'':instdir+'/a/b/python'}, packages=['apackage','package.tests'], ext_modules=[hoc

install_requires based on python version

为君一笑 提交于 2019-12-18 10:33:10
问题 I have a module that works both on python 2 and python 3. In Python<3.2 I would like to install a specific package as a dependency. For Python>=3.2. Something like: install_requires=[ "threadpool >= 1.2.7 if python_version < 3.2.0", ], How can one make that? 回答1: setuptools has support for this using environment markers. install_requires=[ 'enum34;python_version<"3.4"', 'pywin32 >= 1.0;platform_system=="Windows"' ] Use of this is detailed in the official documentation. Based on the change log

Distribute a Python package with a compiled dynamic shared library

喜夏-厌秋 提交于 2019-12-17 23:47:31
问题 How do I package a Python module together with a precompiled .so library? Specifically, how do I write setup.py so that when I do this in Python >>> import top_secret_wrapper It can easily find top_secret.so without having to set LD_LIBRARY_PATH ? In my module development environment, I have the following file structure: . ├── top_secret_wrapper │ ├── top_secret.so │ └── __init__.py └── setup.py Inside __init__.py , I have something like: import top_secret Here's my setup.py from setuptools