setuptools

python installing package with submodules

北战南征 提交于 2019-12-01 03:52:49
问题 I have a custom project package with structure like: package-dir/ mypackage/ __init__.py submodule1/ __init__.py testmodule.py main.py requirements.txt setup.py using cd package-dir followed by $pip install -e . or pip install . as suggested by python-packaging as long as I access the package from package-dir For example : $cd project-dir $pip install . at this point this works: $python -c 'import mypackage; import submodule1' but This does not work $ cd some-other-dir $ python -c 'import

How to execute a (safe) bash shell command within setup.py?

余生颓废 提交于 2019-12-01 00:19:27
I use nunjucks for templating the frontend in a python project. Nunjucks templates must be precompiled in production. I don't use extensions or asynchronous filters in the nunjucks templates. Rather than use grunt-task to listen for changes to my templates, I prefer to use the nunjucks-precompile command (offered via npm) to sweep the entire templates directory into templates.js. The idea is to have the nunjucks-precompile --include ["\\.tmpl$"] path/to/templates > templates.js command execute within setup.py so I can simply piggyback our deployer scripts' regular execution. I found a

Python module won't install

浪子不回头ぞ 提交于 2019-11-30 22:17:17
问题 This is my setup.py file #!/usr/bin/env python from setuptools import setup from sys import path setup(name= 'conundrum', version= '0.1.0', author= 'elssar', author_email= 'elssar@altrawcode.com', py_modules= ['conundrum'], url= 'https://github.com/elssar/conundrum', license= 'MIT', description= 'A framework agnostic blog generator.', long_description= open(path[0]+'/README.md', 'r').read(), install_requires= [ 'PyYAML >= 3.0.9', 'Markdown >= 2.2.0', 'requests >= 1.0.4', ], ) I have tried

Python - package installed with easy_install is not being detected (PIL 1.1.7)

回眸只為那壹抹淺笑 提交于 2019-11-30 20:11:16
I installed PIL with easy_install but for some reason when I run a file that uses it, I get: ImportError: No module named PIL Does anyone know why this could be? I think it's also worth mentioning that I installed web.py through easy_install and it's working fine. I have the same problem. To me, it looks like a bug in PIL easy_install process. The library is installed, but you have to leave out PIL from imports (aka import Image works), which is obviously wrong. To solve, don't use easy_install to perform the install. Download the tar package and python setup.py install it. This will work.

Running custom setuptools build during install

╄→尐↘猪︶ㄣ 提交于 2019-11-30 19:24:29
I've tried to implement Compass compiling during setuptools' build , but the following code runs compilation during explicit build command and doesn't runs during install . #!/usr/bin/env python import os import setuptools from distutils.command.build import build SETUP_DIR = os.path.dirname(os.path.abspath(__file__)) class BuildCSS(setuptools.Command): description = 'build CSS from SCSS' user_options = [] def initialize_options(self): pass def run(self): os.chdir(os.path.join(SETUP_DIR, 'django_project_dir', 'compass_project_dir')) import platform if 'Windows' == platform.system(): command =

easy_install.exe Permission Denied on Windows 8

大憨熊 提交于 2019-11-30 19:16:15
Running command prompt as an administrator I try to run: easy_install -U setuptools It returns the following: Searching for setuptools Reading https://pypi.python.org/simple/setuptools/ Reading http://peak.telecommunity.com/snapshots/ Reading https://pypi.python.org/pypi/setuptools Best match: setuptools 0.8 Processing setuptools-0.8-py2.7.egg setuptools 0.8 is already the active version in easy-install.pth Installing easy_install-script.py script to C:\Python27\Scripts Installing easy_install.exe script to C:\Python27\Scripts error: C:\Python27\Scripts\easy_install.exe: Permission denied I've

When I run the setuptools .egg “as if it were a shell script”, what's actually happening?

爱⌒轻易说出口 提交于 2019-11-30 17:53:32
问题 From reading this documentation, I've built a mental model of what the command sh setuptools-0.6c11-py2.7.egg actually does, but it's very incomplete and I'm still mystified by a few aspects. My mental model goes something like this: When this command is issued, the egg (which I'd considered as a sort of zip file that handles dependencies cleverly) somehow finds the right version of python on my system, and using that python, "installs itself" to an appropriate location. In practice this

Python setup, install one module as a sub module of another module?

南笙酒味 提交于 2019-11-30 17:51:19
问题 I would like to create a package that installs into a submodule of another python package as an extension. Basically the original module is set up like so: origmodule/ __init__.py stuff.py ext/ __init__.py # This module is empty And then have my extension module installed into the empty origmodule.ext module. Reading the instructions for distutils it was not clear if this is possible or supported. The end goal is so that my extension module once installed would be imported like this: import

easy_install.exe Permission Denied on Windows 8

北战南征 提交于 2019-11-30 16:56:59
问题 Running command prompt as an administrator I try to run: easy_install -U setuptools It returns the following: Searching for setuptools Reading https://pypi.python.org/simple/setuptools/ Reading http://peak.telecommunity.com/snapshots/ Reading https://pypi.python.org/pypi/setuptools Best match: setuptools 0.8 Processing setuptools-0.8-py2.7.egg setuptools 0.8 is already the active version in easy-install.pth Installing easy_install-script.py script to C:\Python27\Scripts Installing easy

Python project using protocol buffers, Deployment issues

China☆狼群 提交于 2019-11-30 16:50:04
问题 I have a Python project that uses setuptools for deployment and I mostly followed this guide regarding project structure. The project uses Google Protocol Buffers to define a network message format. My main issue is how to make setup.py call the protoc-compiler during installation to build the definitions into a _pb2.py file. In this question the advice was given to just distribute the resulting _pb2.py files along with the project. While this might work for very similar platforms, I've found