1
我不知道是否会使用释放我的Python模块安装Python模块:生产用汞存档VS轮
- 汞归档和sourceforge上下载
- 轮和PyPy托管
我现在用了1年,但我认为正确的p ythonic的方法是2
任何建议?
轮子需要pip,wheel,setuptools ...对于简单的模块,与简单的tar提取和setup.py安装相比,它看起来相当复杂。另一方面, ,它似乎现在有点需要点/轮?
我不知道是否会使用释放我的Python模块安装Python模块:生产用汞存档VS轮
我现在用了1年,但我认为正确的p ythonic的方法是2
任何建议?
轮子需要pip,wheel,setuptools ...对于简单的模块,与简单的tar提取和setup.py安装相比,它看起来相当复杂。另一方面, ,它似乎现在有点需要点/轮?
它实际上是很简单。
是的,推荐使用Python wheels以及使用pip来安装和维护软件包的安装。
例子:(打包模块)
setup.py
:实施例:
setup.py
:
from setuptools import setup, find_packages
setup(
name="mypackage",
version="0.0.1",
description="my description",
long_description=open("README.rst", "r").read(),
author="You",
author_email="Your Email Address",
packages=find_packages("."),
)
注:这是一个setup.py
的最低限度例子。请参阅Writing the setup script以获取有关其他可包含的“元数据”的更多信息。
安装wheel这样你就可以建立轮子:
$ pip install wheel
注册并上传您的proejct /模块PyPi:
$ python setup.py bdist_wheel register upload
我建议你有Python Packaging User Guide
另外,如果你没有[pip] 1 []插件talled可以eaisly这样做使用引导脚本(只要你也有Python的isntalled):
$ python <(curl -q -o https://bootstrap.pypa.io/get-pip.py)
很大,工作不错,感谢詹姆斯。 – Marcvs
我已经尝试** wheel install **命令,是否接近** pip install **或** python setup.py install **,因为我找不到指定** - 前缀的方式** dir(我不想要virtualenv)? – Marcvs
@Marcvs如果你在** NOT **上使用[virtualenv](https://pypi.python.org/pypi/virtualenv)进行insinst,那么你将会在痛苦的世界中结束。你可以指定''--user''和'--root''选项作为''pip''。但请使用virtualenv! –