distribute

Installing Python and distribute on Windows 7 gives “Writing failed … permission denied”

被刻印的时光 ゝ 提交于 2019-12-02 03:12:41
I'm on Windows 7 (which I fully admit I don't understand the permissions model of. I'm reading about it in other tabs.) My user is an administrator. When I try to run "python distribute_setup.py" I get "writing failed ... permission denied" errors and then "error: can't create or remove files in install directory". I've freshly installed the Python 3.2.2 MSI installer from python.org. I'm installing 32-bit Python even though I'm on 64 bit Windows, because I will have some dependencies that require it (pyglet, an OpenGL library.) I download distribute_setup.py and run "python distribute_setup

Setting package_dir to ..?

爱⌒轻易说出口 提交于 2019-12-01 15:08:14
问题 I have a Git repository cloned into myproject , with an __init__.py at the root of the repository, making the whole thing an importable Python package. I'm trying to write a setuptools setup.py for the package, which will also sit in the root of the repository, next to the __init__.py file. I want setup.py to install the directory it resides in as a package. It's fine if setup.py itself comes along as part of the installation, but it would be better if it didn't. Ideally this should work also

How do you correct Module already loaded UserWarnings in Python?

*爱你&永不变心* 提交于 2019-11-30 11:09:14
Getting the following kinds of warnings when running most python scripts in the command line: /Library/Python/2.6/site-packages/virtualenvwrapper/hook_loader.py:16: UserWarning: Module pkg_resources was already imported from /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.pyc, but /Library/Python/2.6/site-packages is being added to sys.path import pkg_resources /Library/Python/2.6/site-packages/virtualenvwrapper/hook_loader.py:16: UserWarning: Module site was already imported from /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6

install_requires based on python version

荒凉一梦 提交于 2019-11-29 22:53:13
I have a module that works both on python 2 and python 3. In Python<3.2 I would like to install a specific package as a dependency. For Python>=3.2. Something like: install_requires=[ "threadpool >= 1.2.7 if python_version < 3.2.0", ], How can one make that? setuptools has support for this using environment markers . install_requires=[ 'enum34;python_version<"3.4"', 'pywin32 >= 1.0;platform_system=="Windows"' ] Use of this is detailed in the official documentation . Based on the change log was added in v20.5, but the implementation wasn't stable until v20.8.1 (which was only a gap of 15 days).

How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?

試著忘記壹切 提交于 2019-11-29 20:27:42
The Twisted Plugin System is the preferred way to write extensible twisted applications. However, due to the way the plugin system is structured (plugins go into a twisted/plugins directory which should not be a Python package), writing a proper setup.py for installing those plugins appears to be non-trivial. I've seen some attempts that add 'twisted.plugins' to the 'packages' key of the distutils setup command, but since it is not really a package, bad things happen (for example, an __init__.py is helpfully added by some tools). Other attempts seem to use 'package_data' instead (eg, http:/

Installing distribute in Python 3.3 Ubuntu

给你一囗甜甜゛ 提交于 2019-11-29 18:06:20
I am running Ubuntu 12.04 and I have a distribution of Python 3.3.1 installed. I want to install some packages, so I first sought to install distribute-0.6.38. During the "install" phase, I am encountering the following runtime error ($HOME is the location of my Python3.3 installation): File "$HOME/Python-3.3.1/Lib/zipfile.py", line 583, in _check_compression "Compression requires the (missing) zlib module" RuntimeError: Compression requires the (missing) zlib module I tracked back through the files and function calls, but cannot tell why the creation of the zipfile (I assume this is the root

Why does “python setup.py sdist” create unwanted “PROJECT-egg.info” in project root directory?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 22:19:22
When I run python setup.py sdist it creates an sdist in my ./dist directory. This includes a "PROJECT-egg.info" file in the zip inside my "dist" folder, which I don't use, but it doesn't hurt me, so I just ignore it. My question is why does it also create a "PROJECT-egg.info" folder in my project root directory? Can I make it stop creating this? If not, can I just delete it immediately after creating the sdist? I'm using the 'setup' function imported from setuptools. WindowsXP, Python2.7, Setuptools 0.6c11, Distribute 0.6.14. My setup config looks like: {'author': 'Jonathan Hartley', 'author

Packaging resources with setuptools/distribute

倾然丶 夕夏残阳落幕 提交于 2019-11-28 20:50:00
I'm developing an Python egg that has several .txt dependencies (they're templates used to generate files by the egg itself), and I'm struggling to get those dependencies copied to site-packages during setup.py install . According to the distribute documentation ... Filesystem of my package: setup.py package |--- __init__.py |--- main.py |--- binary (calls main.py with pkg_resources.load_entry_point) |--- templates |--file1.txt |--file2.txt In setup.py: setup( [...] eager_resources = ['templates/file1.txt', 'templates/file2.txt'] ) Within my package: from pkg_resources import resource_string

How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?

人盡茶涼 提交于 2019-11-28 16:29:13
问题 The Twisted Plugin System is the preferred way to write extensible twisted applications. However, due to the way the plugin system is structured (plugins go into a twisted/plugins directory which should not be a Python package), writing a proper setup.py for installing those plugins appears to be non-trivial. I've seen some attempts that add 'twisted.plugins' to the 'packages' key of the distutils setup command, but since it is not really a package, bad things happen (for example, an __init__

How do I use data in package_data from source code?

瘦欲@ 提交于 2019-11-28 04:08:35
In setup.py, I have specified package_data like this: packages=['hermes'], package_dir={'hermes': 'hermes'}, package_data={'hermes': ['templates/*.tpl']}, And my directory structure is roughly hermes/ | | docs/ | ... | hermes/ | | __init__.py | code.py | templates | | python.tpl | | README | setup.py The problem is that I need to use files from the templates directory in my source code so I can write out python code (this project is a parser generator). I can't seem to figure out how to properly include and use these files from my code. Any ideas? The standard pkgutil module's get_data()