distutils

DistutilsOptionError: must supply either home or prefix/exec-prefix — not both

不羁的心 提交于 2019-11-26 07:53:00
问题 I\'ve been usually installed python packages through pip. For Google App Engine, I need to install packages to another target directory. I\'ve tried: pip install -I flask-restful --target ./lib but it fails with: must supply either home or prefix/exec-prefix -- not both How can I get this to work? 回答1: Are you using OS X and Homebrew? The Homebrew python page https://github.com/Homebrew/brew/blob/master/docs/Homebrew-and-Python.md calls out a known issue with pip and a work around. Worked for

pip cannot uninstall <package>: “It is a distutils installed project”

感情迁移 提交于 2019-11-26 07:48:01
问题 I tried to install the Twilio module: sudo -H pip install twilio And I got this error: Installing collected packages: pyOpenSSL Found existing installation: pyOpenSSL 0.13.1 Cannot uninstall \'pyOpenSSL\'. 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. Anyone know how to uninstall pyOpenSSL? 回答1: This error means that this package's metadata doesn't include a list of files that belong to it.

How to tell distutils to use gcc?

陌路散爱 提交于 2019-11-26 07:22:15
问题 I want to wrap a test project containing C++ and OpenMP code with Cython, and build it with distutils via a setup.py file. The content of my file looks like this: from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize from Cython.Distutils import build_ext modules = [Extension(\"Interface\", [\"Interface.pyx\", \"Parallel.cpp\"], language = \"c++\", extra_compile_args=[\"-fopenmp\"], extra_link_args=[\"-fopenmp\"])] for e in modules: e

Collapse multiple submodules to one Cython extension

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 05:38:45
问题 This setup.py: from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize extensions = ( Extension(\'myext\', [\'myext/__init__.py\', \'myext/algorithms/__init__.py\', \'myext/algorithms/dumb.py\', \'myext/algorithms/combine.py\']) ) setup( name=\'myext\', ext_modules=cythonize(extensions) ) Doesn\'t have the intended effect. I want it to produce a single myext.so , which it does; but when I invoke it via python -m myext.so I get: ValueError:

pip ignores dependency_links in setup.py

女生的网名这么多〃 提交于 2019-11-26 04:40:05
问题 I have dependency_links in my setup.py: ... dependency_links = [\'http://github.com/robot-republic/python-s3/tarball/master.tar.gz#egg=python-s3\'], ... But it doesn\'t work. However install_requires works fine. Maybe there are another method to set up git repo as required for setup.py? 回答1: This answer should help. In a nutshell, you need to specify the version (or "dev") for the #egg=python-s3 so it looks like #egg=python-s3-1.0.0 . Updates based on @Cerin's comment: Pip 1.5.x has a flag to

How can I bundle other files when using cx_freeze?

非 Y 不嫁゛ 提交于 2019-11-26 04:38:40
问题 I\'m using Python 2.6 and cx_Freeze 4.1.2 on a Windows system. I\'ve created the setup.py to build my executable and everything works fine. When cx_Freeze runs, it moves everything to the build directory. I have some other files that I would like included in my build directory. How can I do this? Here\'s my structure: src\\ setup.py janitor.py README.txt CHNAGELOG.txt helpers\\ uncompress\\ unRAR.exe unzip.exe Here\'s my snippet: setup ( name=\'Janitor\', version=\'1.0\', description=\

How do I point easy_install to vcvarsall.bat?

南笙酒味 提交于 2019-11-26 02:51:14
问题 I already have MSVC++ 2010 Express installed, and my vcvarsall.bat file is at C:\\Program Files\\Microsoft Visual Studio 10.0\\VC , which is in my system PATH. When I run easy_install , it can\'t find vcvarsall.bat. Is there something I need to set in my distutils.cfg file to point it to my MSVC++ installation? G:\\>easy_install hg-git install_dir C:\\Python26\\Lib\\site-packages\\ Searching for hg-git Best match: hg-git 0.2.6 Processing hg_git-0.2.6-py2.6.egg hg-git 0.2.6 is already the

Compiling with cython and mingw produces gcc: error: unrecognized command line option &#39;-mno-cygwin&#39;

你。 提交于 2019-11-26 02:42:50
问题 I\'m trying to compile a python extension with cython in win 7 64-bit using mingw (64-bit). I\'m working with Python 2.6 (Active Python 2.6.6) and with the adequate distutils.cfg file (setting mingw as the compiler) When executing > C:\\Python26\\programas\\Cython>python setup.py build_ext --inplace I get an error saying that gcc has not an -mno-cygwin option: > C:\\Python26\\programas\\Cython>python setup.py build_ext --inplace running build_ext skipping \'hello2.c\' Cython extension (up-to

Including non-Python files with setup.py

我怕爱的太早我们不能终老 提交于 2019-11-26 02:29:02
问题 How do I make setup.py include a file that isn\'t part of the code? (Specifically, it\'s a license file, but it could be any other thing.) I want to be able to control the location of the file. In the original source folder, the file is in the root of the package. (i.e. on the same level as the topmost __init__.py .) I want it to stay exactly there when the package is installed, regardless of operating system. How do I do that? 回答1: Probably the best way to do this is to use the setuptools

How can I make setuptools install a package that&#39;s not on PyPI?

爱⌒轻易说出口 提交于 2019-11-26 02:16:14
问题 I\'ve just started working with setuptools and virtualenv. My package requires the latest python-gearman that is only available from GitHub. The python-gearman version that\'s on PyPI is an old one. The Github source is setuptools-compatible, i.e. has setup.py, etc. Is there a way to make setuptools download and install the new version instead of looking for it on PyPI and installing the old one? FYI, the new python-gearman is http://github.com/mtai/python-gearman 回答1: The key is to tell easy