setup.py

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

核能气质少年 提交于 2019-11-27 02:32:20
问题 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 =

setup.py: restrict the allowable version of the python interpreter

孤者浪人 提交于 2019-11-27 01:41:57
I have a python library. Unfortunately I have not updated it to work with python 3 yet. in its setup.py, I added install_requires=['python<3'], My intent was to not allow this package to be installed / used under python 3, because I know it doesn't (yet) work. I don't think this is the right way to do it, because pip then tries to download and install python 2.7.3 (which is already the installed version!). How should I specify my library dependency on a particular range of python interpreter versions? Should I add a Programming Language :: Python :: 2 :: Only tag? Will this actually prevent

How may I override the compiler (gcc) flags that setup.py uses by default?

隐身守侯 提交于 2019-11-26 21:55:29
I understand that setup.py uses the same CFLAGS that were used to build python. I have a single C extension of ours that is segfaulting. I need to build it without -O2 because -O2 is optimizing out some values and code so that the core files are not sufficient to pin down the problem. I just need to modify setup.py so that -O2 is not used. I've read distutils documentation, in particular distutils.ccompiler and distutils.unixcompiler and see how to add flags and libs and includes, but not how to modify the default gcc flags. Specifically, this is for a legacy product on Python 2.5.1 with a

How to install Python module without setup.py?

假装没事ソ 提交于 2019-11-26 20:52:13
问题 I'm new to Python and am trying to install this module: http://www.catonmat.net/blog/python-library-for-google-search/ There is no setup.py in the directory, but there are these files: BeautifulSoup.py browser.pyc __init__.pyc sponsoredlinks.py BeautifulSoup.pyc googlesets.py search.py translate.py browser.py __init__.py search.pyc Can someone please tell me how to setup or use this module? Thanks! 回答1: The simplest way to begin using that code on your system is: put the files into a

How can I include package_data without a MANIFEST.in file?

喜你入骨 提交于 2019-11-26 20:23:08
问题 How can I include package_data for sdist without a MANIFEST.in file? My setup.py looks like this: import setuptools setuptools.setup( name='foo', version='2015.3', license='commercial', packages=setuptools.find_packages(), package_data={'': ['foo/bar.txt']}, ) Versions: user@host> python Python 2.7.6 (default, Mar 22 2014, 22:59:56) >>> import setuptools >>> setuptools.version.__version__ '3.6' I just can't get foo/bar.txt included. Or is this blog post still true? http://blog.codekills.net

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

爱⌒轻易说出口 提交于 2019-11-26 18:55:54
问题 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 -

set file permissions in setup.py file

只谈情不闲聊 提交于 2019-11-26 16:46:27
问题 I created a python software install with setup.py . In this software I use data files (XML file) when I install these xml file using setup.py then these files save with other files in /usr/lib/python2.7/site_packages/XYZ . But file permission set to these files (XML Files) rwx------ means only super user(root) can read these file I want to change the file permission of XML files as rwxr----- means current user can also read that file. How do I change the data files permission. 回答1: The

python setup.py uninstall

你离开我真会死。 提交于 2019-11-26 10:56:15
I have installed a python package with python setup.py install . How do I uninstall it? Martin v. Löwis Note: Avoid using python setup.py install use pip install . You need to remove all files manually, and also undo any other stuff that installation did manually. If you don't know the list of all files, you can reinstall it with the --record option, and take a look at the list this produces. To record a list of installed files, you can use: python setup.py install --record files.txt Once you want to uninstall you can use xargs to do the removal: xargs rm -rf < files.txt Or if you're running

Python 3: ImportError “No Module named Setuptools”

烈酒焚心 提交于 2019-11-26 10:16:25
I'm having troubles with installing packages in Python 3. I have always installed packages with setup.py install . But now, when I try to install the ansicolors package I get: importerror "No Module named Setuptools" I have no idea what to do because I didn't have setuptools installed in the past. Still, I was able to install many packages with setup.py install without setuptools. Why should I get setuptools now? I can't even install setuptools because I have Python 3.3 and setuptools doesn't support Python 3. Why doesn't my install command work anymore? tiago Your setup.py file needs

setup.py: restrict the allowable version of the python interpreter

雨燕双飞 提交于 2019-11-26 09:47:11
问题 I have a python library. Unfortunately I have not updated it to work with python 3 yet. in its setup.py, I added install_requires=[\'python<3\'], My intent was to not allow this package to be installed / used under python 3, because I know it doesn\'t (yet) work. I don\'t think this is the right way to do it, because pip then tries to download and install python 2.7.3 (which is already the installed version!). How should I specify my library dependency on a particular range of python