setuptools

How to include and install local dependencies in setup.py in Python?

自闭症网瘾萝莉.ら 提交于 2020-01-10 03:38:06
问题 I am creating a setup.py to distribute my application. This application has a number of dependencies which can be installed via pip, it also has some custom dependencies which can not be installed from PyPI. So, I have created a custom_package_0.1.whl which will be included into the distribution and must be installed as a dependency after setup.py installs everything from install_requires . Imagine the following app structure: my_app/ win_deps/custom_package_0.1.whl my_app/ __init__.py main

Managing resources in a Python project

浪子不回头ぞ 提交于 2020-01-09 12:24:28
问题 I have a Python project in which I am using many non-code files. Currently these are all images, but I might use other kinds of files in the future. What would be a good scheme for storing and referencing these files? I considered just making a folder "resources" in the main directory, but there is a problem; Some images are used from within sub-packages of my project. Storing these images that way would lead to coupling, which is a disadvantage. Also, I need a way to access these files which

Importing Python package - “ImportError: No module named…”

橙三吉。 提交于 2020-01-07 03:56:04
问题 I know there are a lot of questions about "ImportError: No module named..." but they ususally seem to boil down to no __init__.py file or the package directory not in $PYTHONPATH . I've checked both of those issues and my issue is not down to them. I have a project which contains protocol buffer definitions. There's a makefile which generates the source as Python, Java or Go. There's a setup.py file which executes make python . I've run pip install -e . in this directory which generates the

Inconsistent behaviour of bdist vs sdist when distributing a Python package

一笑奈何 提交于 2020-01-06 20:02:02
问题 I have a big project with the following structure. utilities is a collections of small modules that are reused in various places by the different components of the big_project , project1 , 2, etc. big_project/ |-- __init__.py |-- utilities/ |-- mod1.py |-- mod2.py |-- project1/ |-- setup.py |-- __init__.py |-- src/ |-- __init__.py |-- mod1.py |-- mod2.py |-- examples/ |-- __init__.py |-- mod.py |-- project2/ |-- ... |-- project3/ |-- ... I want to distribute project1 , including utilities

Error in installing setuptools (unorderable types: str() < NoneType())

早过忘川 提交于 2020-01-06 12:47:52
问题 Python 3.4.2, 32 bit - Win 8.1, 64 bit First I was trying to upgrade setuptools, but it was not successful. So I decided to uninstall the previous version. Now I can't install setuptools. I have tried the following: pip install setuptools: Exception: Traceback (most recent call last): File "C:\Python34\lib\site-packages\pip\basecommand.py", line 232, in main status = self.run(options, args) File "C:\Python34\lib\site-packages\pip\commands\install.py", line 339, in run requirement_set.prepare

Error in installing setuptools (unorderable types: str() < NoneType())

天大地大妈咪最大 提交于 2020-01-06 12:46:15
问题 Python 3.4.2, 32 bit - Win 8.1, 64 bit First I was trying to upgrade setuptools, but it was not successful. So I decided to uninstall the previous version. Now I can't install setuptools. I have tried the following: pip install setuptools: Exception: Traceback (most recent call last): File "C:\Python34\lib\site-packages\pip\basecommand.py", line 232, in main status = self.run(options, args) File "C:\Python34\lib\site-packages\pip\commands\install.py", line 339, in run requirement_set.prepare

Using setuptools, how can I download external data upon installation?

风格不统一 提交于 2020-01-06 03:14:09
问题 I'd like to create some ridiculously-easy-to-use pip packages for loading common machine-learning datasets in Python. (Yes, some stuff already exists, but I want it to be even simpler.) What I'd like to achieve is this: User runs pip install dataset pip downloads the dataset, say via wget http://mydata.com/data.tar.gz . Note that the data does not reside in the python package itself, but is downloaded from somewhere else. pip extracts the data from this file and puts it in the directory that

How do you make Python console script entry points work when installed package uses a conda virtual environment?

旧时模样 提交于 2020-01-05 03:51:33
问题 Problem - Shifting from non-virtual to a conda virtual environment causes console script entry points to be unrecognized. Background - I recently tried to get religion about using virtual environments for my Python projects. I decided to do this after update to macOS Catalina caused all of my PyCharm projects to show invalid interpreter errors. I thought "What could go wrong throwing one big mess on top of another?" Two days later I could finally run a script again - the worst brick wall I've

Python - setuptools - working on two dependent packages (in a single repo?)

不想你离开。 提交于 2020-01-04 09:16:53
问题 I am working on a python project which contains two modules. The modules are very closely related and hence I want them to be in the same git repo, and to be able to develop them together in my IDE: module1 depends on module2 module1 has lots of other heavy dependencies, module2 does not module1 and module2 will be used in different runtime environments module2 should be installable separately so it can run in e.g. an AWS Lambda Consequently I have tried to set up a project structure which

How to keep data_files between package updates?

╄→гoц情女王★ 提交于 2020-01-04 09:04:18
问题 I'm using the data_files argument of setuptools.setup() to install config files to /etc and the users home directory. However updating the package with pip install <package-name> uninstalls the old version and all config files before it installs the new version. How do I keep the config files during updates if they have been changed? 回答1: I very much doubt that eggs or wheels "installers" can do that. They are rather primitive distribution formats suitable for simple things (uninstall the