setup.py

How do I install Python packages in Google's Colab?

こ雲淡風輕ζ 提交于 2019-12-31 17:37:32
问题 In a project, I have e.g. two different packages, How can I use the setup.py to install these two packages in the Google's Colab, so that I can import the packages? 回答1: You can use !setup.py install to do that. Colab is just like a Jupyter notebook. Therefore, we can use the ! operator here to install any package in Colab. What ! actually does is, it tells the notebook cell that this line is not a Python code, its a command line script . So, to run any command line script in Colab, just add

In setup.py or pip requirements file, how to control order of installing package dependencies?

末鹿安然 提交于 2019-12-30 04:11:07
问题 I've got a Python package with its setup.py having dependencies declared via the usual way, in install_requires=[...]. One of the packages there, scikits.timeseries, has a setup.py expecting numpy to already be installed, thus, I'd like some way to have numpy installed first. For this case and in general, can the order of dependency installation be controlled? How? Currently the order in which setup.py pulls down dependencies (as listed in the arg install_requires) seems practically random.

How can I use python distutils to cross compile an extension module to a different architecture?

那年仲夏 提交于 2019-12-25 09:12:49
问题 I'm using Cython to generate compiled .so files for a couple of python modules I have. As outlined in the Cython documentation, you can create a setup.py file as follows: from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize([ 'MyModule1.py', 'MyModule2.py', 'MyModule3.py' ]) ) and then build the modules using the command python3 setup.py build_ext --inplace . This works fine, however it creates binaries that match the architecture of the host

“AttributeError: 'module' object has no attribute” with installed package

落花浮王杯 提交于 2019-12-25 06:49:56
问题 I have a project with these contents: proj ├── src │ ├── scriptA.py │ ├── scriptB.py │ └── __init__.py ├── LICENCE ├── README.md └── setup.py I am following this guide to package this project for PiPY. The setup.py file looks like: #!/usr/bin/python3 # coding=utf8 from setuptools import setup setup( name = "proj", version = "0.2", packages = ['src'], install_requires=[], entry_points={ 'console_scripts': [ 'scriptA=src:scriptA', 'scriptB=src:scriptB' ], }, # metadata for upload to PyPI author

Fetching remote git branch through Python setuptools

岁酱吖の 提交于 2019-12-25 04:02:19
问题 I've been sitting on this for a while now and here is the question. Do you know if I'm able to reference a git branch in setup.py in any way? Is '@' sign supposed to do that? Or is it used solely for tags and commits? Here is an example of what I was trying to do. # setup.py ... install_requires=['Django==1.5.11'] dependency_links=['git+https://github.com/django-nonrel/django.git@nonrel-1.5#egg=Django-1.5.11'] ... #python setup.py develop running develop running egg_info ... Processing

Fetching remote git branch through Python setuptools

心不动则不痛 提交于 2019-12-25 04:01:12
问题 I've been sitting on this for a while now and here is the question. Do you know if I'm able to reference a git branch in setup.py in any way? Is '@' sign supposed to do that? Or is it used solely for tags and commits? Here is an example of what I was trying to do. # setup.py ... install_requires=['Django==1.5.11'] dependency_links=['git+https://github.com/django-nonrel/django.git@nonrel-1.5#egg=Django-1.5.11'] ... #python setup.py develop running develop running egg_info ... Processing

How to define dependency links in setup.py, for installing modules which are not present in PyPI

佐手、 提交于 2019-12-25 03:19:11
问题 I have a requirement (icdiff) for my module newprog and this module is present only on github, its not on PyPi, so I am writing the urls in dependency_links[], dependency_links=["https://github.com/vnitinv/icdiff/blob/master/icdiff.py"], install_requires=['icdiff'] But this is not working for me.It is giving Downloading/unpacking icdiff (from newprog==0.1) Could not find any downloads that satisfy the requirement icdiff (from newprog==0.1) Cleaning up... No distributions at all found for

How to define dependency links in setup.py, for installing modules which are not present in PyPI

╄→尐↘猪︶ㄣ 提交于 2019-12-25 03:19:11
问题 I have a requirement (icdiff) for my module newprog and this module is present only on github, its not on PyPi, so I am writing the urls in dependency_links[], dependency_links=["https://github.com/vnitinv/icdiff/blob/master/icdiff.py"], install_requires=['icdiff'] But this is not working for me.It is giving Downloading/unpacking icdiff (from newprog==0.1) Could not find any downloads that satisfy the requirement icdiff (from newprog==0.1) Cleaning up... No distributions at all found for

Installing from custom index setup.py

若如初见. 提交于 2019-12-24 11:34:24
问题 I am the package maintainer of a package that has dependencies to packages hosted in our own pip repository. I want these packages to also be installed when doing pip install mypackage . setup( name='mypackage', version='1.1.2', description='My awesome package', dependency_links=[ 'http://www.myrepo.se/packages/mydep1/', 'http://www.myrepo.se/packages/mydep2/' ] install_requires=[ 'mydep1==1.0.0', 'mydep2==5.6.7' ] ) The folder structure in the repo is the following: packages/ mydep1/ mydep1

how do I make setup.py play nice with code that's both a library and an application

ぃ、小莉子 提交于 2019-12-24 10:55:56
问题 I'm creating a library, but the library is also an application. Therefore, I'm trying to make the code as painless as possible for people with no real background in programming. I decided to go along with suggestions in this post. However, I'm running into all sorts of issues. I want users to do $ make config $ make install I need to do this because it's actually a C++/Python code, so I'm mixing them with Swig and Cmake. My objective is then to make those config and install targets so