setuptools

How do I remove packages installed with Python's easy_install?

我只是一个虾纸丫 提交于 2019-12-17 01:19:10
问题 Python's easy_install makes installing new packages extremely convenient. However, as far as I can tell, it doesn't implement the other common features of a dependency manager - listing and removing installed packages. What is the best way of finding out what's installed, and what is the preferred way of removing installed packages? Are there any files that need to be updated if I remove packages manually (e.g. by rm /usr/local/lib/python2.6/dist-packages/my_installed_pkg.egg or similar)? 回答1

Python 库打包分发(setup.py 编写)

两盒软妹~` 提交于 2019-12-14 09:18:57
Python 有非常丰富的第三方库可以使用,很多开发者会向 pypi 上提交自己的 Python 包。要想向 pypi 包仓库提交自己开发的包,首先要将自己的代码打包,才能上传分发。 distutils 简介 distutils 是标准库中负责建立 Python 第三方库的安装器,使用它能够进行 Python 模块的安装和发布。distutils 对于简单的分发很有用,但功能缺少。大部分Python用户会使用更先进的setuptools模块 setuptools 简介 setuptools 是 distutils 增强版,不包括在标准库中。其扩展了很多功能,能够帮助开发者更好的创建和分发 Python 包。大部分 Python 用户都会使用更先进的 setuptools 模块。 Setuptools 有一个 fork 分支是 distribute 。它们共享相同的命名空间,因此如果安装了 distribute, import setuptools 时实际上将导入使用 distribute 创建的包。Distribute 已经合并回 setuptools。 还有一个大包分发工具是 distutils2 ,其试图尝试充分利用distutils,detuptools 和 distribute 并成为 Python 标准库中的标准工具。但该计划并没有达到预期的目的,且已经是一个废弃的项目。

Python ex_setup.py urlopen error [Errno 11004] getaddrinfo failed

て烟熏妆下的殇ゞ 提交于 2019-12-14 02:34:59
问题 I just installed Python on Windows 7 as described on http://docs.pylonsproject.org/projects/pyramid/en/1.4-branch/narr/install.html. Im at step 3 and get the following error when I run the python ez_setup.py command. I go the ez_setup.py from this URL http://peak.telecommunity.com/dist/ez_setup.py c:\Python27>python ez_setup.py Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-p y2.7.egg Traceback (most recent call last): File "ez_setup.py", line 278, in <module>

How to include .exe, apt-get and brew install files on a PyPi setup.py file

心已入冬 提交于 2019-12-13 17:00:23
问题 I'm writing a setup.py file to install an OpenSource project using PyPi package. The thing is, this project requires to install as well outside apps ( ghostscript , imagemagick , and tesseract ). These apps have different ways to install depending on the platform (win, linux, or mac). I wrote a file that when I execute python setup.py install install all of it. The problem is when I load the tar and whl files on PyPi and I execute pip install Gap-ML it is just installing the modules but it is

How to find the location of a python package installed via egg-link?

时光毁灭记忆、已成空白 提交于 2019-12-13 14:11:53
问题 I'm working on a plugin architecture and need to convert a package name like "foo.bar" to the absolute path where the code resides. imp.find_module seems to do what I want, except when the code in question is installed via an egg-link (installed via 'pip install develop'). If there are two modules foo.bar and foo.bar2 which are installed via egg-links (and which live at completely separate file system locations like /home/bob/foo/bar and /home/alice/foo/bar2), find_modules doesn't work

ImportError: No module named sysconfig--can't get pip working

情到浓时终转凉″ 提交于 2019-12-13 13:03:58
问题 I'm really struggling with pip on a RedHat 6.9 system. Every time I tried to use pip, I got ImportError: No module named sysconfig I tried Googling for solutions. I don't have apt-get and can't seem to get it with yum, so purging setuptools was out of the question. I did my best to delete setuptools by hand so I could reinstall them, but yum is convinced there are still setuptools on the machine. Pretty much any of the advice involving downloading something with yum doesn't work for me. Yum

Add a dll/so to a python built distribution

时光总嘲笑我的痴心妄想 提交于 2019-12-13 12:04:49
问题 I've compiled the python wrapper of nanomsg and I want to create a python installer for the package. The package can be created by running python setup.py bdist --format=wininst However I would like nanomsg.dll/nanomsg.so to be included in the installer/package but I haven't found any documentation regarding this issue. 回答1: As stated in the documentation here one needs to add the following code to his setup.py script: setup( name='nanomsg', version=__version__, packages=[str('nanomsg'), str(

How to make setuptools install a wheel containing multiple packages?

对着背影说爱祢 提交于 2019-12-13 09:46:48
问题 Suppose this wheel: M Filemode Length Date Time File - ---------- -------- ----------- -------- ------------------------------------------- -rw-rw-r-- 1358 26-Sep-2018 21:08:40 azure/common/__init__.py -rw-rw-r-- 327 26-Sep-2018 21:08:40 azure/common/_version.py -rw-rw-r-- 8737 26-Sep-2018 21:08:40 azure/common/client_factory.py -rw-rw-r-- 755 26-Sep-2018 21:08:40 azure/common/cloud.py -rw-rw-r-- 2479 26-Sep-2018 21:08:40 azure/common/credentials.py -rw-rw-r-- 805 26-Sep-2018 21:08:40 azure

How to specify bracket dependencies in setup.py?

梦想与她 提交于 2019-12-13 09:36:37
问题 Related to this question: What do square brackets mean in pip install? I have a setup.py file that needs to install azure[common] package. However, if I try: setup( ... install_requires=['azure[common]'], ... ) This results in an error: pkg_resources.UnknownExtra: azure 4.0.0 has no such extra feature 'common' But, if I do: pip install 'azure[common]', then it works. There were a lot of bugs and unexpected behavior involved in the experiment above, so the question doens't really make sense

Including .gitignore in setup? - Error: doesn't exist or not a regular file

谁说我不能喝 提交于 2019-12-13 06:53:06
问题 setup.py from setuptools import setup, find_packages from os import path from functools import partial if __name__ == '__main__': package_name = 'gen' templates_join = partial(path.join, path.dirname(__file__), package_name, 'templates') setup( name=package_name, test_suite=package_name + '.tests', packages=find_packages(), package_dir={package_name: package_name}, package_data={package_name: [templates_join('.gitignore')]} ) Tree . ├── gen │ ├── __init__.py │ ├── templates │ │ ├── __init__