setuptools

Add numpy.get_include() argument to setuptools without preinstalled numpy

南楼画角 提交于 2019-11-29 07:21:04
I am currently developing a python package that uses cython and numpy and I want the package to be installable using the pip install command from a clean python installation. All dependencies should be installed automatically. I am using setuptools with the following setup.py : import setuptools my_c_lib_ext = setuptools.Extension( name="my_c_lib", sources=["my_c_lib/some_file.pyx"] ) setuptools.setup( name="my_lib", version="0.0.1", author="Me", author_email="me@myself.com", description="Some python library", packages=["my_lib"], ext_modules=[my_c_lib_ext], setup_requires=["cython >= 0.29"],

setup.py exclude some python files from bdist

孤者浪人 提交于 2019-11-29 06:39:49
I have a django project with this kind of architecture : setup.py project/ __init__.py manage.py settings/ __init__.py base.py dev.py urls/ __init__.py base.py dev.py I wanted to deploy it in a .egg without my 'dev.py' files. I tried different ways : first, with a find_packages(exclude=['*.dev','dev']) , then with a MANIFEST.in which contains : global-exclude dev.py The second solution seems to work when I do a sdist - with this warning when I install it : warning: no previously-included files matching 'dev.py' found anywhere in distribution , but does'nt work with a bdist-egg. Here a part of

安装Tensorflow问题,ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus......

帅比萌擦擦* 提交于 2019-11-29 06:32:57
在Anaconda当中安装tensorfolw遇到以下问题,解决方案: 一、ERROR: Cannot uninstall ‘wrapt’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. 解决办法: 输入:pip install -U --ignore-installed wrapt enum34 simplejson netaddr 二、ERROR: tensorboard 1.14.0 has requirement setuptools>=41.0.0, but you’ll have setuptools 39.1.0 which is incompatible. 原因: setuptools 版本太低 解决方法: 更新setuptools版本,输入: pip install --upgrade setuptools 来源: https://blog.csdn.net/qq_27512741/article/details/100540148

Cross Compiling Python Extensions

眉间皱痕 提交于 2019-11-29 05:58:50
I have a problem cross compiling netifaces extension under Buildroot Linux distro for ARM (Python 2.7.2). According to this blog http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/ I've defined CC, LDSHARE etc. environment variables, but distutils/setuptools doesn't take CC into account so all tests will fail: running build Setting prefix Setting prefix running build_ext checking for getifaddrs... not found. (cached) checking for getnameinfo... not found. (cached) checking for socket IOCTLs... not found. (cached) checking for optional header files... netash/ash.h

【ZZ】Python安装模块出错(ImportError: No module named s...

安稳与你 提交于 2019-11-29 05:35:23
在window平台下安装第三方模块时,出现这样的错误: Google了以下,才知道原来Python里少了这个模块。 我们可以在Python官网去查找 其中 Package Index中查我们需要的模块,进行下载安装即可。 参考如下: http://blog.sina.com.cn/s/blog_3fe961ae0100zgav.html Python第三方模块中一般会自带setup.py文件,在Windows环境下,我们只需要使用命令 cd c:\Temp\foo python setup.py install 两个命令就可以完成第三方模块的安装了。第一个cd命令将当前目前切换到待安装的第三方模块的目录下(这里假设第三方模块解压后的目录为c:\Temp\foo),第二个命令就执行安装了。安装的过程中可能会出现“ImportError: No module named setuptools”的错误提示,这是新手很常遇见的错误提示。不用担心,这是因为Windows环境下Python默认是没有安装setuptools这个模块的,这也是一个第三方模块。下载地址为 http://pypi.python.org/pypi/setuptools 。 如果是Windows环境的话,下载exe形式的安装程序就可以了(傻瓜式安装,非常快)。安装了setuptools之后,再运行“python

Difference between setup.py install and setup.py develop

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 04:23:51
I am trying to improve my workflow when developing python modules and have a rather basic question. What exactly happens when choosing either option. To my knowledge develop leaves the files in place so I can modify them and play around with the package whereas install copies them in the site-packages folder of my python installation. How is the package linked to my python installation when using the develop option. develop creates an .egg-link file in the site-packages directory, which points back to the location of the project files. The same path is also added to the easy-install.pth file

How to distribute `.desktop` files and icons for a Python package in Gnome (with distutils or setuptools)?

点点圈 提交于 2019-11-29 04:12:06
Currently I'm using the auto-tools to build/install and package a project of mine, but I would really like to move to something that feels more "pythonic". My project consists of two scripts, one module, two glade GUI descriptions, and two .desktop files. It's currently a pure python project, though that's likely to change soon-ish. Looking at setuptools I can easily see how to deal with everything except the .desktop files; they have to end up in a specific directory so that Gnome can find them. Is using distuils/setuptools a good idea to begin with? I managed to get this to work, but it

ImportError: No module named extern

假装没事ソ 提交于 2019-11-29 03:22:02
I'm getting this error when trying to install any package with pip. I have two pip instances, one with Python 2.7 and other with Python 3. Could not import setuptools which is required to install from a source distribution. Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 375, in setup_py import setuptools # noqa File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 11, in <module> from setuptools.extern.six.moves import filterfalse, map File "/usr/local/lib/python2.7/dist-packages/setuptools/extern/__init__.py",

setuptools troubles — excluding packages, including data files

烂漫一生 提交于 2019-11-29 03:05:08
I'm fairly new to setuptools. I've seen a few similar questions and it drives a little bit insane that I've seemed to follow advice I saw but setuptools still does something different than what I want. Here is the structure of my project: . .. package1/ __init__.py abc.py ... tests/ __init__.py test_package1.py LICENSE README.md RELEASE setup.py And here is the contents of my setup.py: #!/usr/bin/env python import os #from distutils.core import setup from setuptools import setup, find_packages setup( name='package1', version='1.1', test_suite="tests", packages=find_packages(exclude=['tests']),

Enforcing python version in setup.py

China☆狼群 提交于 2019-11-29 02:56:31
Currently, we are setting\installing up some packages on system by mentioning their version and dependencies in setup.py under install_requires attribute. Our system requires python 2.7. Sometimes, users are having multiple versions of python say 2.6.x and 2.7, some packages it says are available already but actually on the system available under 2.6 site packages list. Also some users has 2.6 only, how to enforce from setup.py or is there any other way to say to have only python 2.7 and all packages which we want setup.py to update are for only 2.7. We require minimum 2.7 on the machine to