scottlawsonbc / stldiff

Simple .stl diff tool with 3D viewer
13 stars 2 forks source link

Runtime requirements: python version, and explicit versioning for flask and numpy-stl #26

Open inactivist opened 6 months ago

inactivist commented 6 months ago

Thanks for providing this utility.

I'm trying to deploy this locally in a Python venv. I'd like to know specific versions for Python interpreter, flask and numpy-stl deps so I can replicate a working environment here.

https://github.com/scottlawsonbc/stldiff/blob/a08ba5d510b086fab4a5fbe0c8e69a5eaf776888/requirements.txt#L1-L2

Background

I've tried setting up a Python 3.9.4 virtualenv, and running pip install -r requirements.txt:

$ pip install -r requirements.txt 
Collecting flask
  Using cached flask-3.0.2-py3-none-any.whl (101 kB)
Collecting numpy-stl
  Downloading numpy_stl-3.1.1-py3-none-any.whl (20 kB)
Collecting gunicorn==19.9.0
  Downloading gunicorn-19.9.0-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 6.4 MB/s 
Collecting Werkzeug==0.16.0
  Downloading Werkzeug-0.16.0-py2.py3-none-any.whl (327 kB)
     |████████████████████████████████| 327 kB 15.0 MB/s 
Collecting Jinja2==2.10.1
  Downloading Jinja2-2.10.1-py2.py3-none-any.whl (124 kB)
     |████████████████████████████████| 124 kB 15.5 MB/s 
Collecting MarkupSafe==1.1.1
  Downloading MarkupSafe-1.1.1-cp39-cp39-manylinux2010_x86_64.whl (32 kB)
Collecting certifi==2019.9.11
  Downloading certifi-2019.9.11-py2.py3-none-any.whl (154 kB)
     |████████████████████████████████| 154 kB 15.6 MB/s 
Collecting importlib-metadata>=3.6.0; python_version < "3.10"
  Downloading importlib_metadata-7.0.2-py3-none-any.whl (24 kB)
Collecting click>=8.1.3
  Using cached click-8.1.7-py3-none-any.whl (97 kB)
Collecting blinker>=1.6.2
  Using cached blinker-1.7.0-py3-none-any.whl (13 kB)
Collecting itsdangerous>=2.1.2
  Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting python-utils>=3.4.5
  Downloading python_utils-3.8.2-py2.py3-none-any.whl (27 kB)
Collecting numpy
  Downloading numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
     |████████████████████████████████| 18.2 MB 18.3 MB/s 
Collecting zipp>=0.5
  Downloading zipp-3.18.0-py3-none-any.whl (8.2 kB)
Collecting typing-extensions>3.10.0.2
  Downloading typing_extensions-4.10.0-py3-none-any.whl (33 kB)
Installing collected packages: zipp, importlib-metadata, click, blinker, MarkupSafe, Jinja2, itsdangerous, Werkzeug, flask, typing-extensions, python-utils, numpy, numpy-stl, gunicorn, certifi
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

flask 3.0.2 requires Jinja2>=3.1.2, but you'll have jinja2 2.10.1 which is incompatible.
flask 3.0.2 requires Werkzeug>=3.0.0, but you'll have werkzeug 0.16.0 which is incompatible.
Successfully installed Jinja2-2.10.1 MarkupSafe-1.1.1 Werkzeug-0.16.0 blinker-1.7.0 certifi-2019.9.11 click-8.1.7 flask-3.0.2 gunicorn-19.9.0 importlib-metadata-7.0.2 itsdangerous-2.1.2 numpy-1.26.4 numpy-stl-3.1.1 python-utils-3.8.2 typing-extensions-4.10.0 zipp-3.18.0

Here's what happens when I try to run app.py:

$ python app.py 
Traceback (most recent call last):
  File "/home/pythondev/playground/scottlawsonbc-stldiff/app.py", line 3, in <module>
    import flask
  File "/home/pythondev/.pyenv/versions/stldiff/lib/python3.9/site-packages/flask/__init__.py", line 5, in <module>
    from . import json as json
  File "/home/pythondev/.pyenv/versions/stldiff/lib/python3.9/site-packages/flask/json/__init__.py", line 6, in <module>
    from ..globals import current_app
  File "/home/pythondev/.pyenv/versions/stldiff/lib/python3.9/site-packages/flask/globals.py", line 25, in <module>
    app_ctx: AppContext = LocalProxy(  # type: ignore[assignment]
TypeError: __init__() got an unexpected keyword argument 'unbound_message'
haralamb commented 2 months ago

Thank you @scottlawsonbc for this app! I have just managed to run it and for me it works with only 2 lines in the requirements.txt

Flask==3.0.3
numpy-stl==3.1.1

and these commands

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
flask run

Great !!