setuptools

easy_install lxml on Python 2.7 on Windows

孤者浪人 提交于 2019-11-30 06:19:24
问题 I'm using python 2.7 on Windows. How come the following error occurs when I try to install [lxml][1] using [setuptools][2]'s easy_install? C:\>easy_install lxml Searching for lxml Reading http://pypi.python.org/simple/lxml/ Reading http://codespeak.net/lxml Best match: lxml 2.3.3 Downloading http://lxml.de/files/lxml-2.3.3.tgz Processing lxml-2.3.3.tgz Running lxml-2.3.3\setup.py -q bdist_egg --dist-dir c:\users\my_user\appdata\local\temp\easy_install-mtrdj2\lxml-2.3.3\egg-dist-tmp-tq8rx4

How to handle python packages with conflicting names?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 04:56:05
I'm using two python packages that have the same name. http://www.alembic.io/updates.html https://pypi.python.org/pypi/alembic Is there a canonical or pythonic way to handle installing two packages with conflicting names? So far, I've only occasionally needed one of the packages during development/building, so I've been using a separate virtualenv to deal with the conflict, but it makes the build step more complex and I wonder if there isn't a better way to handle it. You could use the --target option for pip and install to an alternate location: pip install --target=/tmp/test/lib/python3.6

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

混江龙づ霸主 提交于 2019-11-30 03:58:06
问题 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. 回答1: 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

Eggs in path before PYTHONPATH environment variable

不羁岁月 提交于 2019-11-30 03:24:25
If I have packages installed from easy_install , the eggs are prepended to sys.path before the items in the PYTHONPATH variable. For example, if I have an egg package called foo installed as well as a package called foo in the current directory, and then do this: PYTHONPATH="." python >>> import foo This will use the egg version of foo instead of the local directory. Inspecting sys.path shows that eggs are placed before items from PYTHONPATH . This seems broken. Is there any way to override this behavior? Unfortunately this is done with a hard-coded template deep inside setuptools/command/easy

Running custom setuptools build during install

若如初见. 提交于 2019-11-30 03:23:05
问题 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,

Ubuntu + virtualenv = a mess? virtualenv hates dist-packages, wants site-packages

假装没事ソ 提交于 2019-11-30 02:04:31
Can someone please explain to me what is going on with python in ubuntu 9.04? I'm trying to spin up virtualenv , and the --no-site-packages flag seems to do nothing with ubuntu. I installed virtualenv 1.3.3 with easy_install (which I've upgraded to setuptools 0.6c9 ) and everything seems to be installed to /usr/local/lib/python2.6/dist-packages I assume that when installing a package using apt-get, it's placed in /usr/lib/python2.6/dist-packages/ ? The issue is, there is a /usr/local/lib/python2.6/site-packages as well that just sits there being empty. It would seem (by looking at the path in

stopping setup.py from installing as egg

风流意气都作罢 提交于 2019-11-30 01:10:23
How do I stop setup.py from installing a package as an egg? Or even better, how do I easy_install from installing a package as an egg ? sudo python setup.py install The reason being that PyDev is rather picky about packages in egg format... The package I am interested in at the moment is boto . Update: I found the brute force way of doing it: sudo easy_install -m boto cd path/to/boto-xyz.egg sudo mv boto .. sudo rm -rf boto-xyz.egg I feel like I'm missing something subtle or important (encountering this page years after the question was asked and not finding a satisfying answer) however the

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).

Offline Installation of python & pip

谁说胖子不能爱 提交于 2019-11-29 22:32:37
问题 I need to install python on a sever to run scripts but the server has no access to the internet. The server has access to a local network that has access to the internet*. I would like to use pip to manage the packages through a local network directory as specified here. How can I install pip, python and their dependancies on a windows machine, offline so that I can use pip, as specified in the link above to manage the packages I require? *For Clarity: I have no ability to mirror, hack or

How to solve pkg_resources.VersionConflict error during bin/python bootstrap.py -d

久未见 提交于 2019-11-29 21:23:08
I am tring to create a new plone environment using python plone-devstart.py tool. I got a bootstrap error. So i used a command bin/python bootstrap.py -d from my project directory. It(bin/python bootstrap.py -d command) worked fine before But now i got an error like oomsys@oomsysmob-6:~/demobrun$ bin/python bootstrap.py -d Downloading http://pypi.python.org/packages/source/d/distribute/distribute- 0.6.49.tar.gz Extracting in /tmp/tmpDqVwYA Now working in /tmp/tmpDqVwYA/distribute-0.6.49 Building a Distribute egg in /tmp/tmpv4Bzyv /tmp/tmpv4Bzyv/distribute-0.6.49-py2.7.egg Traceback (most