setuptools

Installing Python-2.7 on Ubuntu 10.4

十年热恋 提交于 2019-11-27 08:55:16
I can't seem to install zlib properly, I installed Python from source on Ubuntu10.4 '######## edit ##################### bobince and Luper helped. Make sure you install these packages and then recompile Python: sudo aptitude install zlib1g-dev libreadline6-dev libdb4.8-dev libncurses5-dev '################################# After installation, I attempted to install setuptools.py $ sh setuptools-0.6c11-py2.7.egg Traceback (most recent call last): File "<string>", line 1, in <module> zipimport.ZipImportError: can't decompress data; zlib not available I then installed zlib: $ sudo aptitude

Prevent package from being installed on old Python versions

蓝咒 提交于 2019-11-27 07:36:04
问题 What can we put in a setup.py file to prevent pip from collecting and attempting to install a package when using an unsupported Python version? For example magicstack is a project listed with the trove classifier: Programming Language :: Python :: 3 :: Only So I expect the following behaviour if pip --version is tied to python 2.7: $ pip install magicstack Collecting magicstack Could not find a version that satisfies the requirement magicstack (from versions: ) No matching distribution found

How to Bootstrap numpy installation in setup.py

十年热恋 提交于 2019-11-27 06:54:00
I have a project which has a C extension which requires numpy. Ideally, I'd like whoever downloads my project to just be able to run python setup.py install or use one call to pip . The problem I have is that in my setup.py I need to import numpy to get the location of the headers, but I'd like numpy to be just a regular requirement in install_requires so that it will automatically be downloaded from the Python Package Index. Here is a sample of what I'm trying to do: from setuptools import setup, Extension import numpy as np ext_modules = [Extension('vme', ['vme.c'], extra_link_args=['-lvme']

Why doesn't setup_requires work properly for numpy?

拥有回忆 提交于 2019-11-27 06:44:25
问题 I wanted to create a setup.py file that automatically resolves a build-time dependency to numpy (for compiling extensions). My first guess was to use setup_requires and subclass a command class to import the numpy module: from setuptools import setup, Extension from distutils.command.build import build as _build class build(_build): def run(self): import numpy print(numpy.get_include()) _build.run(self) setup( name='test', version='0.0', description='something', cmdclass={'build':build},

Python ez_install : UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 11

[亡魂溺海] 提交于 2019-11-27 06:28:00
问题 Getting the error below trying to install ez_install, Windows 7 64 bit machine with fresh Python 2.7. Any ideas? Installing Setuptools Traceback (most recent call last): File "setup.py", line 17, in exec(init_file.read(), command_ns) File "", line 8, in File "c:\users\namar\appdata\local\temp\tmp1tanvy\setuptools-2.1\setuptools\__ init__.py", line 11, in from setuptools.extension import Extension File "c:\users\namar\appdata\local\temp\tmp1tanvy\setuptools-2.1\setuptools\ex tension.py", line

setup.py: run build_ext before anything else

时光怂恿深爱的人放手 提交于 2019-11-27 06:17:33
问题 I'm working with a setup.py that creates a whole bunch of SWIG interface files during the build_ext step. This needs to run first, because subsequent build steps need a full list of the python files to work properly (like copying the python files to the package directory, creating the egg, creating the sources list, etc.). This is what currently happens when you do setup.py install : running install running bdist_egg running egg_info running install_lib running build_py running build_ext The

How can I use setuptools to generate a console_scripts entry point which calls `python -m mypackage`?

独自空忆成欢 提交于 2019-11-27 05:42:56
问题 I am trying to be a good Pythonista and following PEP 338 for my package I plan on deploying. I am also trying to generate my executable scripts upon python setuptools install using setuptools entry_points{'console_scripts': ... } options. How can I use entry_points to generate a binary that calls python -m mypackage (and passes *args, **kwargs) ? Here are a few attempts I have made with no success: setuptools( ... (1) entry_points= {'console_scripts': ['mypkg=mypkg.__main__'],}, (2) entry

Python setuptools: How can I list a private repository under install_requires?

浪子不回头ぞ 提交于 2019-11-27 05:30:49
问题 I am creating a setup.py file for a project which depends on private GitHub repositories. The relevant parts of the file look like this: from setuptools import setup setup(name='my_project', ..., install_requires=[ 'public_package', 'other_public_package', 'private_repo_1', 'private_repo_2', ], dependency_links=[ 'https://github.com/my_account/private_repo_1/master/tarball/', 'https://github.com/my_account/private_repo_2/master/tarball/', ], ..., ) I am using setuptools instead of distutils

Python Packaging: Data files are put properly in tar.gz file but are not installed to virtual environment

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 05:18:39
问题 I can't properly install the project package_fiddler to my virtual environment. I have figured out that MANIFEST.in is responsible for putting the non-.py files in Package_fiddler-0.0.0.tar.gz that is generated when executing python setup.py sdist . Then I did: (virt_envir)$ pip install dist/Package_fiddler-0.0.0.tar.gz But this did not install the data files nor the package to /home/username/.virtualenvs/virt_envir/local/lib/python2.7/site-packages . I have tried many configurations of the

How do I install an old version of Django on virtualenv?

我的梦境 提交于 2019-11-27 05:13:48
问题 This may sound like a stupid question, since the very purpose of virtualenv is to this exactly: Installing some specific version of a package (in this case Django) inside the virtual environment. But it's exactly what I want to do, and I can't figure it out. I'm on Windows XP, and I created the virtual environment successfully, and I'm able to run it, but how am I supposed to install the Django version I want into it? I mean, I know to use the newly-created easy_install script, but how do I