Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Using install_requires
#1
I have created a test application which uses 'pillow'. I inserted a line in install.py:
install_requires=['pillow']
I then ran the following commands create the distribution and install it, they both worked:
python setup.py sdist
pip3 install dist/*.tar.gz
I now want to take another step and include 'hugin-tools', so I added it to install.py as above, and also put 'hugin-tools' in requirements.txt. I then ran the commands to create the distribution and install it, and the creation runs, but the installation errors:
Output:
chris@desktop:~/Snaps/cob$ pip3 install dist/*.tar.gz Processing ./dist/cob-0.tar.gz Collecting pillow (from cob==0) Using cached https://files.pythonhosted.org/packages/85/5e/e91792f198bbc5a0d7d3055ad552bc4062942d27eaf75c3e2783cf64eae5/Pillow-5.4.1-cp36-cp36m-manylinux1_x86_64.whl Collecting hugin-tools (from cob==0) Could not find a version that satisfies the requirement hugin-tools (from cob==0) (from versions: ) No matching distribution found for hugin-tools (from cob==0) chris@desktop:~/Snaps/cob$
Clearly it can't find hugin-tools, how should I correctly indicate to pip3 where to find it?
Quote
#2
where from you are supposed to get this hugin-tools package? Can you provide link? as you can see it's not available on pypi (https://pypi.org/search/?q=hugin)
Looking at http://hugin.sourceforge.net/docs/manual...rface.html - maybe you want this one https://pypi.org/project/HSI/
Quote
#3
I have downloaded and unzipped camocomp and panorama as they both suggest that they use hugin, but I can't see how they include it.
Quote
#4
I would suggest to use HSI - it's the one referred on their page and is updated April 2018.
panorama is updated in 2017. If you look at the github repo it uses subprocess to call hugin via CLI. As it is not updated since 2017 it may have problems with latest versions of python.
camocomp is updated in 2013 so I would guess it's long time dead project and would not rely on it (e.g. it will not work with latest versions of python)
Quote
#5
@buran
Quote:HSI
HSI is an extension of Python. Import the hsi module and access Hugin functionality from your scripts.
To see what objects and methods are available, run
python -c 'import hsi; help(hsi)' > help.txt
Doesn't appear to have what I want, which is align-image-stack.

@buran
Quote:I would suggest to use HSI - it's the one referred on their page and is updated April 2018.
panorama is updated in 2017. If you look at the github repo it uses subprocess to call hugin via CLI.
I'm a bit confused, do you mean:
Use HSI, which uses panorama, which uses a subprocess which uses CLI to call hugin? Not sure what CLI is though.

@buran
I think you are suggesting that:
1) use HSI
2) camocamp is defunct.
3) panorama uses a subprocess to call hugin via CLI (OS command?).

1) Having had a look at the list I can't find align-image-stack, so no good.
2) Defunct so don't use.
3) This could work as I use an OScommand from Python to run align-image-stack. How would I ensure that hugin was available?
Quote
#6
(Feb-04-2019, 08:40 PM)ChrisOfBristol Wrote: Doesn't appear to have what I want, which is align-image-stack.
I doubt others will have it too
It looks like it's just CLI tool
With Hugin installed this tool should be available and you can use subprocess module to execute it from python. That's the approach that panorama is using for creating panorama images.
Quote
#7
(Feb-04-2019, 08:40 PM)ChrisOfBristol Wrote: think you are suggesting that:
1) use HSI
2) camocamp is defunct.
3) panorama uses a subprocess to call hugin via CLI (OS command?).

yes - all of the above

(Feb-04-2019, 08:40 PM)ChrisOfBristol Wrote: 3) This could work as I use an OScommand from Python to run align-image-stack. How would I ensure that hugin was available?
I also suggest that - just use subprocess.run() instead of os.system is depreciated
Quote
#8
@buran
OK, I have hugin installed on my computer. Should I expect
pip3 install dist/*.tar.gz
to install without error (it doesn't). or should I remove
install_requires=['hugin']
and ensure in some other way that hugin is available?


-----------------------------------------------------------------------------------------------------------------------------------------

When it's all working I'll learn about subprocess.run and change my code.

..or isn't the PyPI format capable of ensuring that something which will be run as an OS command is installed?
Quote
#9
install_requires does not handle any software, just python packages required. Hugin is just some external software. You can list it as dependency, e.g. in a readme file and user should take care to install it themselves. You may use some install creator (like NSIS on Windows) that will create installer that will also download and install external dependencies. Eventually you can write a code to download and install Hugin yourself.
Quote
#10
@buran OK, that's an important distinction. The GUI is created with Glade and GTK3+/PyGTK, does this count as a Python package or external software?
Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)