setup.py

Compiling Python 3.6.9 on Windows

我只是一个虾纸丫 提交于 2020-06-17 11:39:13
问题 I am trying to install Python 3.6.9 and am having problems. First I downloaded Python-3.6.9-tgz, then extracted it to get Python-3.6.9.tar, then extracted that to get a folder called Python-3.6.9 This has setup.py in it. So on windows 10 I opened the command prompt and navigated to that folder and typed: setup.py install . This opens up visual studio that I already have and does nothing. Please let me know if I need to do something else. I tried to add environmental variables but nothing has

How do I distribute my pip package with data files correctly?

不想你离开。 提交于 2020-06-14 02:58:19
问题 I have a following package to distribute: mymodule/ data/ 1.txt mymodule/ __init__.py tests/ test_mymodule.py setup.py In order to install it under a vitualenv I apply this command: pip install . Everything is installed fine but the path to my data file becomes broken. >>> from mymodule import get >>> print(get()) ... FileNotFoundError: [Errno 2] No such file or directory: '/home/alexander/Stuff/pip_example/mymodule_test/venv/lib/python3.5/site-packages/mymodule/../data/1.txt' I made a

Installing dependencies of a local dependency with pipenv

懵懂的女人 提交于 2020-06-10 09:27:23
问题 Background We have project with the following high-level directory structure* ./datascience/ ├── core │ └── setup.py ├── notebooks │ └── Pipfile └── web └── Pipfile *Excluded all the irrelevant files and directories for brevity. The core package is a library. It's a dependency of both the notebooks and web applications. The core package, being a library, has its dependencies specified in setup.py import setuptools setuptools.setup( install_requires=[ 'some-dependency', 'another-dependency' ]

Installing dependencies of a local dependency with pipenv

我的梦境 提交于 2020-06-10 09:25:22
问题 Background We have project with the following high-level directory structure* ./datascience/ ├── core │ └── setup.py ├── notebooks │ └── Pipfile └── web └── Pipfile *Excluded all the irrelevant files and directories for brevity. The core package is a library. It's a dependency of both the notebooks and web applications. The core package, being a library, has its dependencies specified in setup.py import setuptools setuptools.setup( install_requires=[ 'some-dependency', 'another-dependency' ]

How to include (script-built) libraries with package installation?

浪尽此生 提交于 2020-06-01 03:23:26
问题 I am making a Python package that has a C++-extension module and someone else's shared library that it requires. I want everything installable via pip . My current setup.py file works when I use pip install -e . but when I don't use develop mode (e.i. omit the -e ) I get "cannot open shared object file" when importing the module in Python. I believe the reason is that setuptools doesn't consider the shared library to be part of my package, so the relative link to the library is broken during

How to include (script-built) libraries with package installation?

天大地大妈咪最大 提交于 2020-06-01 03:23:13
问题 I am making a Python package that has a C++-extension module and someone else's shared library that it requires. I want everything installable via pip . My current setup.py file works when I use pip install -e . but when I don't use develop mode (e.i. omit the -e ) I get "cannot open shared object file" when importing the module in Python. I believe the reason is that setuptools doesn't consider the shared library to be part of my package, so the relative link to the library is broken during

Python pkg_resources and file access in packages

China☆狼群 提交于 2020-05-29 07:06:55
问题 I'm building my first python package (which I then install with pip) and I need to use some non-python files. In these answers, it is explained that I should use the pkg_resources function. But I can't figure out a working example. Let say I have this project structure: package_name/ ----data/ --------image.png ----package_name/ --------__init__.py --------file.py ----setup.py ----MANIFEST.in ----conf.yml Now I want to access conf.yml and image.png from file.py . How should I proceed in: file

setup.py dependency_links Pypi name conflict

不羁的心 提交于 2020-05-15 07:42:47
问题 I have a non-Pypi package that I want to install using setup.py file, so I include it in the dependency_links : dependency_link=['package_url.tar.gz'] The problem there's another package with the same name on Pypi, so the setup.py just ignores my dependency_links line and installs that. Is there a way around this? 来源: https://stackoverflow.com/questions/41602869/setup-py-dependency-links-pypi-name-conflict

How do you get the filename of a Python wheel when running setup.py?

不羁岁月 提交于 2020-05-14 18:33:26
问题 I have a build process that creates a Python wheel using the following command: python setup.py bdist_wheel The build process can be run on many platforms (Windows, Linux, py2, py3 etc.) and I'd like to keep the default output names (e.g. mapscript-7.2-cp27-cp27m-win_amd64.whl ) to upload to PyPI. Is there anyway to get the generated wheel's filename (e.g. mapscript-7.2-cp27-cp27m-win_amd64.whl ) and save to a variable so I can then install the wheel later on in the script for testing?

Python setup.py with private repository on GitLab as dependency_links based on commit ID

独自空忆成欢 提交于 2020-05-09 06:59:06
问题 I am trying to install a private dependency (not something that Python could find on PyPI). I have added to the file setup.py this (as explained here: https://python-packaging.readthedocs.io/en/latest/dependencies.html#packages-not-on-pypi): dependency_links = [ 'https://gitlab.com/<PRIVATE_ORG>/<PRIVATE_REPO>.git@<COMMIT_ID>' ] On that official documentation they don't really explain in details what's the format of that URL, however using a <COMMIT_ID after the @ sounds reasonable (as it's