setuptools

Python - Packaging Alembic Migrations with Setuptools

夙愿已清 提交于 2020-02-23 08:50:11
问题 What is the right way to package Alembic migration files in a Setuptools setup.py file? Everything is in my repo root as alembic/ . This is a Python application, not a library. My desired installation flow is that someone can pip install the wheel that is my application. They would then be able to initialize the application database by running something like <app> alembic upgrade --sqlalchemy.url=<db_url> . Upgrades would then require a pip install -U , after which they can run the Alembic

nvalidSchema: Missing dependencies for SOCKS support

佐手、 提交于 2020-02-19 17:59:01
首先需要安装pip3 1. 安装 setuptools wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26 tar -zxvf setuptools-19.6.tar.gz cd setuptools-19.6.tar.gz python3 setup.py build python3 setup.py install 2. 安装pip3 wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb tar -zxvf pip-8.0.2.tar.gz cd pip-8.0.2 python3 setup.py build python3 setup.py install 然后安装 pysocks pip3 install pysocks from: https://www.cnblogs.com/wenchengxiaopenyou/p/5709218.html

Setuptools platform specific dependencies

*爱你&永不变心* 提交于 2020-02-18 18:17:08
问题 Is there any way to tell setuptools or distribute to require a package on a specific platform? In my specific case, I'm using readline , which comes as part of the standard library on Unix systems, but on Windows I need the pyreadline module to replace that functionality (cf. this question). If I just put it in the requirements It also installs on Unix systems where it's completely useless. 回答1: When I first wrote my answer here, in 2013, we didn't yet have PEP 496 – Environment Markers and

PyQt5 dependency in a module on Debian [duplicate]

喜夏-厌秋 提交于 2020-02-08 02:27:11
问题 This question already has answers here : Install PyQt5 5.14.1 on Linux (2 answers) Closed yesterday . I have a Python module with a __main__ that uses PyQt5. I've installed PyQt5 on a Debian Buster box: apt-get install python3-pyqt5 The __main__ program runs as expected if I execute python3 mymodule/__main__.py from the source directory. Now I've installed the module into python: python3 setup.py install That worked. The setup.py lists a dependency on pyqt5: setup( # ... install_requires=[

python学习:基础概念

ぃ、小莉子 提交于 2020-02-06 16:17:06
Python 包管理工具解惑 python packaging 一、困惑 作为一个 Python 初学者,我在包管理上感到相当疑惑(嗯,是困惑)。主要表现在下面几个方面: 这几个包管理工具有什么不同? * distutils * setuptools * distribute * disutils2 * distlib * pip 2. 什么时候该用pip,什么时候该用 setup.py ,它们有关系么? 3. easy_install 、 ez_setup.py 、 setup.py 、 setup.cfg 分别都是干啥的? 4. wheel 和 pip 的关系? 5. Egg 和 whl 的关系? 6. 如何发布自己的模块(发布到PyPI)? 7. 如何进行模块的私有发布(不发布到PyPI)? 为了弄清这些问题,我找了许多资料。最后发现最好的资料还是 python 的官方文档。 下面是阅读了所有我找到的资料后的一个总结,希望能帮到几个月后又把这些全部忘光的那个自己。 二、python 包管理工具大乱斗 用时间顺序来描述乱斗过程。 1. distutils distutils 是 python 标准库的一部分,2000年发布。使用它能够进行 python 模块的 安装 和 发布 。 setup.py 就是利用 distutils 的功能写成,我们可以看一个简单的 setup.py

Python 包管理工具解惑

ⅰ亾dé卋堺 提交于 2020-02-06 16:13:14
本文转载自http://zengrong.net/post/2169.htm,感谢原作者。 一、困惑 作为一个 Python 初学者,我在包管理上感到相当疑惑(嗯,是困惑)。主要表现在下面几个方面: 这几个包管理工具有什么不同? distutils setuptools distribute disutils2 distlib pip 什么时候该用pip,什么时候该用 setup.py ,它们有关系么? easy_install、ez_setup.py、setup.py、setup.cfg 分别都是干啥的? wheel 和 pip 的关系? Egg 和 whl 的关系? 如何发布自己的模块(发布到PyPI)? 如何进行模块的私有发布(不发布到PyPI)? 为了弄清这些问题,我找了许多资料。最后发现最好的资料还是 python 的官方文档。 下面是阅读了所有我找到的资料后的一个总结,希望能帮到几个月后又把这些全部忘光的那个自己。 二、python 包管理工具大乱斗 我用时间顺序来描述乱斗过程。 distutils distutils 是 python 标准库的一部分,2000年发布。使用它能够进行 python 模块的 安装 和 发布。 setup.py 就是利用 distutils 的功能写成,我们可以看一个简单的 setup.py 的例子。 在这里可以看到关于 setupt.py

Python 包管理工具解惑

风流意气都作罢 提交于 2020-02-06 16:12:24
一、困惑 作为一个 Python 初学者,我在包管理上感到相当疑惑(嗯,是困惑)。主要表现在下面几个方面: 这几个包管理工具有什么不同? distutils setuptools distribute disutils2 distlib pip 什么时候该用pip,什么时候该用 setup.py ,它们有关系么? easy_install、ez_setup.py、setup.py、setup.cfg 分别都是干啥的? wheel 和 pip 的关系? Egg 和 whl 的关系? 如何发布自己的模块(发布到PyPI)? 如何进行模块的私有发布(不发布到PyPI)? 为了弄清这些问题,我找了许多资料。最后发现最好的资料还是 python 的官方文档。 下面是阅读了所有我找到的资料后的一个总结,希望能帮到几个月后又把这些全部忘光的那个自己。 二、python 包管理工具大乱斗 我用时间顺序来描述乱斗过程。 distutils distutils 是 python 标准库的一部分,2000年发布。使用它能够进行 python 模块的 安装 和 发布。 setup.py 就是利用 distutils 的功能写成,我们可以看一个简单的 setup.py 的例子。 在这里可以看到关于 setupt.py 格式的所有详细描述:Writing the Setup Script。

How do I install scipy and numpy with setuptools

梦想的初衷 提交于 2020-02-04 02:44:26
问题 I am developing a python 3.4 module which has scipy and numpy as dependencies. So I declared them in my setup.py under install_requires. Here is the minimum running example of my setup.py from setuptools import setup setup( name='MyModule', version='1.0.5', author='Alexander Mueller', packages=[], scripts=[], license='LICENSE.txt', description='Stuff', install_requires=[ "pandas == 0.15.2", "scikit-learn==0.17", "seaborn == 0.5.1", "scipy == 0.17.0", "numpy==1.10.4" ] ) While running python

How do I install scipy and numpy with setuptools

懵懂的女人 提交于 2020-02-04 02:44:19
问题 I am developing a python 3.4 module which has scipy and numpy as dependencies. So I declared them in my setup.py under install_requires. Here is the minimum running example of my setup.py from setuptools import setup setup( name='MyModule', version='1.0.5', author='Alexander Mueller', packages=[], scripts=[], license='LICENSE.txt', description='Stuff', install_requires=[ "pandas == 0.15.2", "scikit-learn==0.17", "seaborn == 0.5.1", "scipy == 0.17.0", "numpy==1.10.4" ] ) While running python

Python打包工具Setuptools的使用

谁说胖子不能爱 提交于 2020-02-03 06:11:26
文章目录 基础使用 打包 Setuptools并非只能用于创建基于脚本的Python安装程序,还可以用于编译扩展,另外,通过将其与扩展py2exe(平台)和py2app(macOS)结合起来使用,还可以创建独立的在各自平台上可执行的程序。 Python打包用户指南 和 Setuptools官网 有很多相关文档可以参考。 基础使用 本文只做一个简单的示例: 1、编写一个简单的python脚本(代码随意),保存为’hello.py’: print ( 'hello world' ) 2、在同级目录下创建’setup.py’文件,代码如下: from setuptools import setup setup ( name = 'Hello' , version = '1.0' , description = 'A simple example' , author = 'tang' , py_modules = [ 'hello' ] ) 并非一定要向函数setup提供示例代码中的所有信息,也可以不提供任何参数 3、执行 setup.py 脚本 ~ python setup.py build running build running build_py creating build creating build/lib copying hello.py - > build/lib