setup.py

spaCy and spaCy models in setup.py

六眼飞鱼酱① 提交于 2020-07-17 07:50:10
问题 In my project I have spaCy as a dependency in my setup.py , but I want to add also a default model. My attempt so far has been: install_requires=['spacy', 'en_core_web_sm'], dependency_links=['https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm'], inside my setup.py , but both a regular pip install of my package and a pip install --process-dependency-links return: pip._internal.exceptions.DistributionNotFound: No

Python3 shared extension doesn't link against library dependency

柔情痞子 提交于 2020-07-08 12:01:25
问题 I'm creating a shared Python extension for my library and I'm using distutils to build it. These are the relevant sections of my setup.py : import distuitls.core as dc from os.path import join as path_join module = dc.Extension(module_name, sources = [path_join(meson_src_root, "py3_bindings", "module.c")], include_dirs = [path_join(meson_src_root, "include")], libraries = ["bbmputil"], runtime_library_dirs = [meson_build_root]) dc.setup(name = module_name, version = module_version,

Src layout to dispense .src prefix in imports? Activate venv in PyCharm terminal for development installs

隐身守侯 提交于 2020-06-29 03:13:17
问题 I want to understand what is considered the correct minimalist way to use setuptools with a "src/ layout" in a way that dispenses using src. prefix in imports? I have read most of the PyPA and setuptools documentation (and its many use cases), but I can't understand what is considered the correct way of doing this example. The below layout reproduces what I want to achieve. I can't understand how to get the second import to work instead of the first across all modules of the mylibrary package

Src layout to dispense .src prefix in imports? Activate venv in PyCharm terminal for development installs

本秂侑毒 提交于 2020-06-29 03:13:09
问题 I want to understand what is considered the correct minimalist way to use setuptools with a "src/ layout" in a way that dispenses using src. prefix in imports? I have read most of the PyPA and setuptools documentation (and its many use cases), but I can't understand what is considered the correct way of doing this example. The below layout reproduces what I want to achieve. I can't understand how to get the second import to work instead of the first across all modules of the mylibrary package

Troubleshooting pkg_resources.DistributionNotFound error

北城以北 提交于 2020-06-27 12:18:32
问题 Why does this simple program result in a pkg_resources.DistributionNotFound error when run and how do we fix it? #setup.py from setuptools import setup setup(name='my_project', version='0.1.0', packages=['my_project'], entry_points={ 'console_scripts': [ 'my_project = my_project.__main__:main' ] }, ) . ##my_project/__main__.py import sys def main(args=None): print("Do Something") if __name__ == "__main__": main() Build: python setup.py install --root=target --prefix=usr Run: .\target\usr