distutils

Cx_Freeze - Include Modules automatically

瘦欲@ 提交于 2019-12-11 20:20:09
问题 should I include modules that I have used in my .py like os module in code below or its done automatically?and what about exclude?I have used pyqt4 in my .py is it necessary to add its name in 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"]} # GUI applications require a different base on Windows (the default is for a # console

Possible to change distutils default compiler options?

北战南征 提交于 2019-12-11 17:42:37
问题 Win 10, x64, minGW64, Python 2.7, Anaconda I am trying to compile zbar for use in Python 2.7 using python setup.py build --compiler=mingw32 Here's setup.py from distutils.core import setup, Extension from distutils.sysconfig import get_config_vars setup( name = 'zbar', version = '0.10', author = 'Jeff Brown', author_email = 'spadix@users.sourceforge.net', url = 'http://zbar.sourceforge.net', description = 'read barcodes from images or video', license = 'LGPL', long_description = open('README'

What's wrong with this `setup.py`?

狂风中的少年 提交于 2019-12-11 17:34:59
问题 I've been having problems withe getting setup.py to do the sdist thing correctly. I boiled it down to this. I have the following directory structure: my_package\ my_subpackage\ __init__.py deep_module.py __init__.py module.py setup.py And here's what I have in setup.py : #!/usr/bin/env python from distutils.core import setup import distutils setup( name='a', version='0.1', description='a', author='a', author_email='a@a.com', url='http://a.org', packages=['my_package','my_package.my_subpackage

How to Make a PyMe (Python library) Run in Python 2.4 on Windows?

纵然是瞬间 提交于 2019-12-11 17:33:10
问题 I want to run this library on Python 2.4 in Windows XP. I installed the pygpgme-0.8.1.win32.exe file but got this: >>> from pyme import core Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\Lib\site-packages\pyme\core.py", line 22, in ? import pygpgme File "C:\Python24\Lib\site-packages\pyme\pygpgme.py", line 7, in ? import _pygpgme ImportError: DLL load failed: The specified module could not be found. And then this pop up comes up ---------------------------

Change output directory in setup.py

≡放荡痞女 提交于 2019-12-11 17:06:47
问题 I'm using setup from setuptools to create a setup.py , and I was wondering if it's possible to change the output directory programmatically to change it from dist/ . I'm aware that you can do this from the command line using the --dist-dir flag, but I want to be able to do from within the setup.py file instead. Anyone have any ideas? 回答1: You need to override code that set the default name: from distutils.command.bdist import bdist as _bdist from distutils.command.sdist import sdist as _sdist

Cannot uninstall 'pandas' (distutils installed project)

帅比萌擦擦* 提交于 2019-12-11 15:48:44
问题 I have created a conda environment where I am installing all the stuff I need. I already had installed the pandas library, but I need to upgrade it to the latest version. However, when I try pip3 install --upgrade pandas I get the following error: Found existing installation: pandas 0.15.2 Cannot uninstall 'pandas'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. I have tried sudo apt-get remove

What is the relationship between setup(name) and Extension(name)

大憨熊 提交于 2019-12-11 13:45:22
问题 I am writing (actually generating) a setup.py script for building a single Python extension with several C++ sources. It is unclear to me what is the relationship between the name specified as the name parameter to distutils.core.setup and the name specified as the name parameter to distutils.core.Extension . So when I have this: distutils.core.setup( name = 'Abc', ext_modules = [ distutils.core.Extension( name = 'Xyz', sources = ['a.cpp', 'b.cpp'] ) ] ) What is the relationship between Abc

Pythonpath is still ignored and unable to install locally with pip

≯℡__Kan透↙ 提交于 2019-12-11 13:03:11
问题 I'm finding that my pythonpath environment variable is ignored. I'm using python 2.6 on ubuntu. I have in my .bashrc the following: export PTYHONPATH=/my/home/mylibs/lib/python2.6/site-packages/:$PYTHONPATH Then I install a new version of numpy using: python setup.py install --prefix=/my/home/mylibs/ and it gets correctly installed locally. However, when I try to install other packages (also using setup.py ) that depend on the new version of numpy, they cannot find it, because by default the

How can I incorporate cmake file when building with distutils python?

我与影子孤独终老i 提交于 2019-12-11 12:14:12
问题 I have a C++ logic which I'm calling from Python. I have created a setup.py using distutils to build and install. The C++ logic has a cmake file. To build the C++ this cmake file needs to be incorporated into the setup.py file. How can I do this? Below is my cmake file for the C++ code. CMAKE_MINIMUM_REQUIRED(VERSION 2.6) set(name "facerec") project(facerec_cpp_samples) #SET(OpenCV_DIR /path/to/your/opencv/installation) # packages find_package(OpenCV REQUIRED) # http://opencv.willowgarage.com

pip freeze captures the package name as if it was on python index site, but it is not. full path is needed

安稳与你 提交于 2019-12-11 06:58:25
问题 I installed a package from git hub: pip install -e git+http://github.com/un33k/django-uuslug.git#egg=django-uuslug Then I did: pip freeze > req.txt I get: django-uuslug==0.1 Now if I do a pip install -r req.txt , I get a package not found error, which due to the fact that django-uuslug is not on pypi. Why is freeze not remembering the full path as it was given during the install? 回答1: I had the same issue. I believe it's a problem whenever the packages are in a subdirectory(e.g. src). Here's