setuptools

Python记录-Pip安装

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 04:11:03
1.第一步 下载py文件: https://bootstrap.pypa.io/ez_setup.py #!/usr/bin/env python """ Setuptools bootstrapping installer. Maintained at https://github.com/pypa/setuptools/tree/bootstrap. Run this script to install or upgrade setuptools. """ import os import shutil import sys import tempfile import zipfile import optparse import subprocess import platform import textwrap import contextlib import json import codecs from distutils import log try: from urllib.request import urlopen from urllib.parse import urljoin except ImportError: from urllib2 import urlopen from urlparse import urljoin try: from site

Use setuptools to install from location

会有一股神秘感。 提交于 2019-12-20 03:49:37
问题 I have a framework for a site that I want to use in multiple projects but I don't want to submit my framework to PyPi. Is there anyway I can tell my setup.py to install the framework from a specific location? Here is my current setup.py from setuptools import setup setup( name='Website', version='0.2.1', install_requires=[ 'boto>=2.6', 'fabric>=1.4', 'lepl>=5.1', 'pygeoip>=0.2.4', 'pylibmc>=1.2.3', 'pymongo>=2.2', 'pyyaml>=3.1', 'requests>=0.12', 'slimit>=0.7.4', 'thrift>=0.8.0', 'tornado>=2

How do I generate python grpc code from within a setuptools installer (setup.py)?

风流意气都作罢 提交于 2019-12-20 02:55:01
问题 We have some proto files for gRPC in a repo and I read that it is not good to commit generated code. So I figured I need to have the generation as part of the package installation (e.g. setuptools, setup.py) However, to generate gRPC code, you need to first install the package by running pip install grpcio-tools according to the docs. But the purpose of setup.py is to automatically pull down dependencies like grpcio-tools . So is there a best-practice for doing this? As in, how to generate

How to use setuptools packages and ext_modules with the same name?

帅比萌擦擦* 提交于 2019-12-19 11:40:18
问题 I got the following file structure for my Python C Extension project: . ├── setup.py ├── source ├── cppimplementation │ └── fastfile.cpp └── fastfilepackage ├── __init__.py └── version.py And I use the following setup.py file: from setuptools import setup, Extension setup( name= 'fastfilepackage', version= '0.1.1', package_dir = { '': 'source', }, packages = [ 'fastfilepackage', ], ext_modules= [ Extension( 'fastfilepackage', [ 'source/cppimplementation/fastfile.cpp', ] ) ], ) I install them

How can I use jython setup.py install?

ぃ、小莉子 提交于 2019-12-19 11:18:35
问题 I am using a Jython virtualenv where I can install whatever software via pip or via easy_install, but there is a software that is not registered yet and the installation mode via: [sudo] python setup.py install and I am trying to do the same with jython: [sudo] jython setup.py install So, I am getting these follow errors: Traceback (most recent call last): File "setup.py", line 3, in <module> from setuptools import setup, find_packages ImportError: No module named setuptools I checked and

Best way to share code across several setup.py scripts?

假装没事ソ 提交于 2019-12-19 08:29:17
问题 I've got several packages I'm working on, and I'd like to share code between their setup.py scripts. Is there any good way to do this or is code duplication my only option? 回答1: Normally setup.py is the entry point for distribution of distinct packages. As such, it's hard to then share code between those packages. If you use setuptools (or it's fork, distribute) in your setup.py , you can specify packages that must be installed when installing your package with the setup_requires entry.

How to make easy_install execute custom commands in setup.py?

南楼画角 提交于 2019-12-19 06:30:07
问题 I want my setup.py to do some custom actions besides just installing the Python package (like installing an init.d script, creating directories and files, etc.) I know I can customize the distutils/setuptools classes to do my own actions. The problem I am having is that everything works when I cd to the package directory and do "python setup.py install", but my custom classes don't seem to be executed when I do "easy_install mypackage.tar.gz". Here's my setup.py file (create an empty myfoobar

How come I can't get the exactly result to *pip install* by manually *python setup.py install*?

最后都变了- 提交于 2019-12-19 06:16:35
问题 I like to figure out the myth behind Python's namespace packages by setuptools , and here is what I did test. Make a virtual environment by virtualenv . Find a namespaced package on PyPI . Install that package by pip install . Check the installed file hierarchy. The package I played with is zope.interface and it worked well with the following file hierarchy on my virtualenv: ~virenv/.../site-packages/zope.interface-3.8.0-py2.6-nspkg.pth /zope.interface-3.8.0-py2.6.egg-info/ /zope/ /interface/

How come I can't get the exactly result to *pip install* by manually *python setup.py install*?

末鹿安然 提交于 2019-12-19 06:16:19
问题 I like to figure out the myth behind Python's namespace packages by setuptools , and here is what I did test. Make a virtual environment by virtualenv . Find a namespaced package on PyPI . Install that package by pip install . Check the installed file hierarchy. The package I played with is zope.interface and it worked well with the following file hierarchy on my virtualenv: ~virenv/.../site-packages/zope.interface-3.8.0-py2.6-nspkg.pth /zope.interface-3.8.0-py2.6.egg-info/ /zope/ /interface/

How come I can't get the exactly result to *pip install* by manually *python setup.py install*?

微笑、不失礼 提交于 2019-12-19 06:16:05
问题 I like to figure out the myth behind Python's namespace packages by setuptools , and here is what I did test. Make a virtual environment by virtualenv . Find a namespaced package on PyPI . Install that package by pip install . Check the installed file hierarchy. The package I played with is zope.interface and it worked well with the following file hierarchy on my virtualenv: ~virenv/.../site-packages/zope.interface-3.8.0-py2.6-nspkg.pth /zope.interface-3.8.0-py2.6.egg-info/ /zope/ /interface/