setup.py

Difference between entry_points/console_scripts and scripts in setup.py?

爱⌒轻易说出口 提交于 2019-11-28 16:57:28
问题 There are basically two ways to install Python console scripts to my path by setup.py : setup( ... entry_points = { 'console_scripts': [ 'foo = package.module:func', ], } ) and setup( ... scripts = [ 'scripts/myscript.sh' ] ) What are the differences? I see the first approach allows me to choose nice, specific name for my script, but are there any other differences? Different original purposes, compatibility (setuptools, distutils, ...?), usage, ...? I am quite confused and a nice elaborated

requirements.txt vs setup.py

回眸只為那壹抹淺笑 提交于 2019-11-28 16:37:42
I started working with Python. I've added requirements.txt and setup.py to my project. But, I am still confused about the purpose of both files. I have read that setup.py is designed for redistributable things and that requirements.txt is designed for non-redistributable things. But I am not certain this is accurate. How are those two files truly intended to be used? requirements.txt This helps you to set up your development environment. Programs like pip can be used to install all packages listed in the file in one fell swoop. After that you can start developing your python script. Especially

Difference between 'python setup.py install' and 'pip install'

ε祈祈猫儿з 提交于 2019-11-28 15:33:53
I have an external package I want to install into my python virtualenv from a tar file. What is the best way to install the package? I've discovered 2 ways that can do it: Extract the tar file, then run python setup.py install inside of the extracted directory. pip install packagename.tar.gz from example # 7 in https://pip.pypa.io/en/stable/reference/pip_install/#examples Is if there is any difference doing them in these 2 ways. On the surface, both do the same thing: doing either python setup.py install or pip install <PACKAGE-NAME> will install your python package for you, with a minimum

pip install . creates only the dist-info not the package

断了今生、忘了曾经 提交于 2019-11-28 11:53:53
I am trying to make a python package which I want to install using pip install . locally. The package name is listed in pip freeze but import <package> results in an error No module named <package> . Also the site-packages folder does only contain a dist-info folder. find_packages() is able to find packages. What am I missing? import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command # Package meta-data. NAME = '<package>' DESCRIPTION = 'description' URL = '' EMAIL = 'email' AUTHOR = 'name' # What packages are required for this module to be

Why do I need to include sub-packages in setup.py

醉酒当歌 提交于 2019-11-28 07:59:48
问题 I have a python package called mltester which contains two sub-packages ( actions , dialogs ) and a main script ml_tester.py , structured as follows: + <ProjectFolder> +---+ <mltester> | +---- <actions> | +---- <dialogs> | +---- ml_tester.py | +---- __init__.py +---- setup.py My __init__.py looks as follows: import actions import dialogs import ml_tester In ml_tester.py I do something like: from actions import * from dialogs import * All works fine when running from eclipse. When doing pip

No module named setuptools

家住魔仙堡 提交于 2019-11-28 07:54:16
I want to install setup file of twilio. When I install it through given command it is given me an error: No module named setuptools. Could you please let me know what should I do? I am using python 2.7 Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Python27>python D:\test\twilio-twilio-python-26f6707\setup.py install Traceback (most recent call last): File "D:\test\twilio-twilio-python-26f6707\setup.py", line 2, in <module> from setuptools import setup, find_packages ImportError: No module named setuptools Arvind Install setuptools and

The command `python setup.py build_ext --inplace` always create a new directory

青春壹個敷衍的年華 提交于 2019-11-28 06:15:22
问题 Suppose I have a python package structured like this: foo/ __init__.py setup.py bar/ __init__.py bar.pyx and the content of setup.py is from distutils.core import setup from Cython.Build import cythonize import numpy as np setup( ext_modules=cythonize("bar/bar.pyx"), include_dirs=[np.get_include()] ) Then I just run python setup.py build_ext --inplace because I need the compiled file bar.so be placed exactly in bar/ . But the previous command creates a new directory foo/bar/ under bar , and

Python Packaging: Data files are put properly in tar.gz file but are not installed to virtual environment

馋奶兔 提交于 2019-11-28 04:20:20
I can't properly install the project package_fiddler to my virtual environment. I have figured out that MANIFEST.in is responsible for putting the non-.py files in Package_fiddler-0.0.0.tar.gz that is generated when executing python setup.py sdist . Then I did: (virt_envir)$ pip install dist/Package_fiddler-0.0.0.tar.gz But this did not install the data files nor the package to /home/username/.virtualenvs/virt_envir/local/lib/python2.7/site-packages . I have tried many configurations of the setup arguments package_data , include_package_data and data_files but I seem to have used the wrong

Why is python setup.py saying invalid command 'bdist_wheel' on Travis CI?

北慕城南 提交于 2019-11-28 03:52:23
My Python package has a setup.py which builds fine locally on Ubuntu Trusty and on a fresh Vagrant Ubuntu Trusty VM when I provision it like this: sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7 sudo -H pip install setuptools wheel virtualenv --upgrade But when I do the same on a Travis CI Trusty Beta VM: - sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken - curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7 -

How to force a python wheel to be platform specific when building it?

我怕爱的太早我们不能终老 提交于 2019-11-28 01:11:44
I am working on a python2 package in which the setup.py contains some custom install commands. These commands actually build some Rust code and output some .dylib files that are moved into the python package. An important point is that the Rust code is outside the python package. setuptools is supposed to detect automatically if the python package is pure python or platform specific (if it contains some C extensions for instance). In my case, when I run python setup.py bdist_wheel , the generated wheel is tagged as a pure python wheel: <package_name>-<version>-py2-none-any.whl . This is