Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hazen to work with Python 3.9 #142

Closed
tomaroberts opened this issue Nov 15, 2021 · 3 comments · Fixed by #143
Closed

Update hazen to work with Python 3.9 #142

tomaroberts opened this issue Nov 15, 2021 · 3 comments · Fixed by #143
Labels
enhancement New feature or request

Comments

@tomaroberts
Copy link
Collaborator

hazen is currently compiled with Python 3.6. This is end-of-life at the end of 2021. We should keep hazen up-to-date with the latest Python versions.

Further still, installing Python 3.6 is particularly troublesome for M1 Apple Silicon users. There are ways of running Python 3.9 on M1 chips via Rosetta (pyenv/pyenv#1768 (comment)), but this is cumbersome.

@tomaroberts tomaroberts added the enhancement New feature or request label Nov 15, 2021
@tomaroberts
Copy link
Collaborator Author

tomaroberts commented Nov 15, 2021

On my M1 Macbook (arch = arm64), I've got most packages installed with Python 3.9 through pip now, except psycopg2-binary and scikit-image. The latter is particularly important for hazen as a lot of the tools use this.

Reading around, the issue boils down to the available wheels for scikit-image, scipy and numpy. Running pip install scikit-image throws build errors associated with numpy, even if you have it installed already. I think the scikit-image build process isn't building numpy properly.

The scikit-image devs are working on creating functioning wheels for Python versions 3.7-3.10, but as of 2 days ago these proposed for a new release (0.19.1) – see here: scikit-image/scikit-image#6021 (comment)

The comment also mentions waiting on the SciPy devs to implement something regarding all of this.

I think it might be a few months before installing all this packages on arm64 using pip is resolved. Lots of places say miniforge seems to be the way to go for now.

For reference, WIP requirements.txt. This might build hazen-3.9 on non-M1 machines, if anyone wants to give it a go (except for psycopg2-binary).

SQLAlchemy_Utils==0.33.11
alembic==1.0.10
celery==4.3.1
numpy==1.21.0
Werkzeug==0.15.4
#scikit_image==0.14.2
opencv-python==4.5.4.58
Flask_Migrate==2.5.1
pytest>=6.2
coverage>=6.0.2
Flask_Moment==0.7.0
flask_heroku==0.1.9
Flask==1.0.3
pydicom==1.4.1
WTForms==2.2.1
Flask_Dropzone==1.5.3
Flask_Mail==0.9.1
Flask_Login==0.4.1
Flask_Bootstrap4==4.0.2
imutils==0.5.3
matplotlib==3.4.3
Flask_SQLAlchemy==2.4.0
scipy==1.7.2
docopt==0.6.2
SQLAlchemy==1.3.3
Flask_WTF==0.14.2
flask_bootstrap==3.3.7.1
PyJWT==1.7.1
gunicorn==19.9.0
#psycopg2-binary==2.8.4
arrow==0.13.2
amqp==2.4.2
sphinxcontrib-needs==0.4.3
sphinxcontrib-napoleon
sphinx_rtd_theme
m2r
python-dateutil
email_validator
colorlog

@tomaroberts
Copy link
Collaborator Author

Created new branch hazen-3.9-miniforge.

Adds environment.yml, for building hazen using miniforge. This works by building with the conda version of scikit-image. Hazen can be run from command line.

pytest tests/ giving 23 errors – see attached output below:

log_pytest.log

@tomaroberts tomaroberts linked a pull request Nov 15, 2021 that will close this issue
@tomaroberts
Copy link
Collaborator Author

Completed in release0.5.0, PR #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant