Opened 2 years ago

Closed 2 years ago

#64158 closed defect (fixed)

py27-flask @2.0.2: ImportError: cannot import name json

Reported by: cooljeanius (Eric Gallager) Owned by: catap (Kirill A. Korinsky)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cjones051073 (Chris Jones)
Port: py-flask

Description

Attempting to upgrade from py27-flask 1.1.4 to 2.0.2 results in the following error for me:

Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-flask/py27-flask/work/Flask-2.0.2" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
DEBUG: system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-flask/py27-flask/work/Flask-2.0.2" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
Traceback (most recent call last):
  File "setup.py", line 14, in <module>
    "dotenv": ["python-dotenv"],
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/__init__.py", line 162, in setup
    return distutils.core.setup(**attrs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 124, in setup
    dist.parse_config_files()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/dist.py", line 702, in parse_config_files
    ignore_option_errors=ignore_option_errors)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/config.py", line 121, in parse_configuration
    meta.parse()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/config.py", line 426, in parse
    section_parser_method(section_options)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/config.py", line 399, in parse_section
    self[name] = value
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/config.py", line 184, in __setitem__
    value = parser(value)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/config.py", line 515, in _parse_version
    version = self._parse_attr(value, self.package_dir)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/config.py", line 349, in _parse_attr
    module = import_module(module_name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-flask/py27-flask/work/Flask-2.0.2/src/flask/__init__.py", line 6, in <module>
    from . import json as json
ImportError: cannot import name json
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-flask/py27-flask/work/Flask-2.0.2" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build 
Exit code: 1
Error: Failed to build py27-flask: command execution failed
DEBUG: Error code: CHILDSTATUS 76720 1

All the python3-series versions of py-flask work fine for me, though (that's py35-flask thru py310-flask).

Change History (5)

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: cjones051073 added
Port: py-flask added; py27-flask removed

comment:2 Changed 2 years ago by reneeotten (Renee Otten)

version 2.x dropped support for PY27 and PY35, so it's not all that surprising that this doesn't work...

comment:3 in reply to:  2 ; Changed 2 years ago by cooljeanius (Eric Gallager)

Replying to reneeotten:

version 2.x dropped support for PY27 and PY35, so it's not all that surprising that this doesn't work...

Huh, if it dropped support for py35, then I guess it is kinda surprising that that still works, though...

comment:4 in reply to:  3 Changed 2 years ago by reneeotten (Renee Otten)

Replying to cooljeanius:

Replying to reneeotten:

version 2.x dropped support for PY27 and PY35, so it's not all that surprising that this doesn't work...

Huh, if it dropped support for py35, then I guess it is kinda surprising that that still works, though...

probably upstream is not explicitly testing anymore with Python 3.5 (and therefore dropped official support), but they might not have used features yet that break there...

comment:5 Changed 2 years ago by catap (Kirill A. Korinsky)

Owner: set to catap
Resolution: fixed
Status: newclosed

In 744f0f83560c6124f2eb2ae013e6355df98fc179/macports-ports (master):

py-flask: update to 2.1.1

Also drop support of python 3.5 and 3.6 which can't be used because it
hasn't got supported by py-werkzeug.

Fixes: #64158

Note: See TracTickets for help on using tickets.