setup.py

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

六月ゝ 毕业季﹏ 提交于 2019-11-29 14:45:27
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 install , the following setup.py works fine: from setuptools import setup setup( name="MLTester", version

Using an extra python package index url with setup.py

浪子不回头ぞ 提交于 2019-11-29 10:47:30
问题 Is there a way to use an extra python package index (ala pip --extra-index-url pypi.example.org mypackage ) with setup.py so that running python setup.py install can find the packages hosted on pypi.example.org ? 回答1: If you're the package maintainer, and you want to host one or more dependencies for your package somewhere other than PyPi, you can use the dependency_links option of setuptools in your distribution's setup.py file. This allows you to provide an explicit location where your

Installing nltk data dependencies in setup.py script

耗尽温柔 提交于 2019-11-29 06:14:40
I use NLTK with wordnet in my project. I did the installation manually on my PC, with pip: pip3 install nltk --user in a terminal, then nltk.download() in a python shell to download wordnet. I want to automatize these with a setup.py file, but I don't know a good way to install wordnet. For the moment, I have this piece of code after the call to setup ( "nltk" is in the install_requires list of the call to setup ): import sys if 'install' in sys.argv: import nltk nltk.download("wordnet") Is there a better way to do this? asmaier I managed to install the NLTK data in setup.py by overriding

pip install PyQt IOError

岁酱吖の 提交于 2019-11-29 06:10:43
问题 I'm trying to install PyQt package with pip, but I get this error: ~$ pip install PyQt Downloading/unpacking PyQt Downloading PyQt-x11-gpl-4.8.3.tar.gz (9.8Mb): 9.8Mb downloaded Running setup.py egg_info for package PyQt Traceback (most recent call last): File "<string>", line 14, in <module> IOError: [Errno 2] No such file or directory: '/home/john/build/PyQt/setup.py' Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 14, in

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

Package only binary compiled .so files of a python library compiled with Cython

匆匆过客 提交于 2019-11-29 02:06:51
I have a package named mypack which inside has a module mymod.py , and the __init__.py . For some reason that is not in debate, I need to package this module compiled (nor .py or .pyc files are allowed). That is, the __init__.py is the only source file allowed in the distributed compressed file. The folder structure is: . │ ├── mypack │ ├── __init__.py │ └── mymod.py ├── setup.py I find that Cython is able to do this, by converting each .py file in a .so library that can be directly imported with python. The question is: how the setup.py file must be in order to allow an easy packaging and

Cython setup.py for several .pyx

爱⌒轻易说出口 提交于 2019-11-29 01:50:18
I would like to cythonize faster. Code for one .pyx is from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize("MyFile.pyx") ) What if i want to cythonize several files with ext .pyx, that i will call by their name all .pyx files in a folder What would be python code for the setup.py in both cases ? From: https://github.com/cython/cython/wiki/enhancements-distutils_preprocessing # several files with ext .pyx, that i will call by their name from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext

Any python function to get “data_files” root directory?

为君一笑 提交于 2019-11-29 01:33:33
This should be a very common question for developers who used "setup.py" to build installation packages and it should be asked before but I couldn't find the proper answer anywhere. In setup.py from distutils.core import setup setup( ...., ...., data_files=[('MyApp/CBV', ['myapp/data/CBV/training.cbv', 'myapp/data/CBV/test.cbv'])], ...., ...., ) Result of sudo python setup.py install running install running build running build_py running build_scripts running install_lib running install_scripts changing mode of /usr/local/bin/MyApp_trainer to 755 changing mode of /usr/local/bin/MyApp_reference

Why does “python setup.py sdist” create unwanted “PROJECT-egg.info” in project root directory?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 22:19:22
When I run python setup.py sdist it creates an sdist in my ./dist directory. This includes a "PROJECT-egg.info" file in the zip inside my "dist" folder, which I don't use, but it doesn't hurt me, so I just ignore it. My question is why does it also create a "PROJECT-egg.info" folder in my project root directory? Can I make it stop creating this? If not, can I just delete it immediately after creating the sdist? I'm using the 'setup' function imported from setuptools. WindowsXP, Python2.7, Setuptools 0.6c11, Distribute 0.6.14. My setup config looks like: {'author': 'Jonathan Hartley', 'author

Install python packages to correct anaconda environment

♀尐吖头ヾ 提交于 2019-11-28 18:13:24
I've setup anaconda and created a python 3.3 environment. Now I wanted to install some package ( dataset ). The install instructions ask to clone the git repo and run python setup.py install but now the packages are not installed to the environments site-packages folder but to a different anaconda location. What are the normal steps to solve that problem? Newbie-compatible solutions are preferred. The OS is MacOSX, just is case, it is relevant. user545424 It looks like conda automatically adds pip to your conda environment, so after you source your conda environment, i.e.: source activate ~