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

enum34 dependency causing crash upon install #429

Closed
schlich opened this issue Aug 6, 2020 · 9 comments
Closed

enum34 dependency causing crash upon install #429

schlich opened this issue Aug 6, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@schlich
Copy link

schlich commented Aug 6, 2020

I am using Poetry to manage dependencies and upon running poetry add dash-bootstrap-components i got this error from the enum34 library. I fixed it by forcing the enum34 version by manually setting the enum34 version to 1.1.8 as suggested in that thread.

@tcbegley
Copy link
Collaborator

tcbegley commented Aug 7, 2020

Hey @schlich

Thanks for reporting, I was unable to reproduce this with

poetry new test
cd test
poetry add dash-bootstrap-components

dash-bootstrap-components only has one dependency which is dash itself (it also has an optional pandas dependency for the Table.from_dataframe function). In fact, after running those commands, enum34 was not contained in my poetry.lock file, suggesting it's not even an indirect dependency?

My best guess is that enum34 is a dependency of one of your other dependencies, and poetry add dash-bootstrap-components triggered poetry's dependency resolver which resulted in the error.

Which versions of Python are you developing for? Since enum34 is a backport of a Python 3.4 feature to earlier versions of Python, it's only relevant to those versions, and if you're developing for later versions you might be able to sidestep the whole issue by simply adding something like

[tool.poetry.dependencies]
python = "^3.6"

in your pyproject.toml file?

@schlich
Copy link
Author

schlich commented Aug 7, 2020

I was already using python 3.8 so not sure where the dependency was either, i didnt see any other packages mentioned in the error message though. Today I removed enum34 from pyproject.toml and everything went smoothly. very strange. sorry to waste your time and thanks for the help!

@schlich schlich closed this as completed Aug 7, 2020
@tcbegley
Copy link
Collaborator

tcbegley commented Aug 7, 2020

No worries, glad the problem resolved itself.

@schlich
Copy link
Author

schlich commented Aug 21, 2020

reopening this since i'm running into the error again... sorry if this is just my lack of understanding of Poetry causing this issue but since it's DBC causing the issue...

here is the error message:

Updating dependencies
Resolving dependencies... (0.5s)                                                                                                                                                                                                                Writing lock file                                                                                                                                                                                                                                                                                                                                                       Package operations: 0 installs, 1 update, 0 removals
- Updating dash-bootstrap-components (0.10.3 -> 0.10.5)
[EnvCommandError]
Command ['/home/tyler/.cache/pypoetry/virtualenvs/gram-D8nqyLvp-py3.8/bin/pip', 'install', '--no-deps', '-U', 'dash-bootstrap-components==0.10.5'] errored with the following return code 1, and output: 
Collecting dash-bootstrap-components==0.10.5
Using cached dash-bootstrap-components-0.10.5.tar.gz (108 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'

ERROR: Command errored out with exit status 1:
command: /home/tyler/.cache/pypoetry/virtualenvs/gram-D8nqyLvp-py3.8/bin/python /home/tyler/.cache/pypoetry/virtualenvs/gram-D8nqyLvp-py3.8/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ijw94hfl/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 40.8.0' wheel
        cwd: None 
Complete output (14 lines):
Traceback (most recent call last): 
  File "/home/tyler/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/tyler/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 87, in _run_code  
    exec(code, run_globals
  File "/home/tyler/.cache/pypoetry/virtualenvs/gram-D8nqyLvp-py3.8/lib/python3.8/site-packages/pip/__main__.py", line 23, in <module>
     from pip._internal.cli.main import main as _main  # isort:skip # noqa
  File "/home/tyler/.cache/pypoetry/virtualenvs/gram-D8nqyLvp-py3.8/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 5, in <module>
    import locale
  File "/home/tyler/.pyenv/versions/3.8.3/lib/python3.8/locale.py", line 16, in <module> 
    import re
  File "/home/tyler/.pyenv/versions/3.8.3/lib/python3.8/re.py", line 145, in <module>
    class RegexFlag(enum.IntFlag): 
AttributeError: module 'enum' has no attribute 'IntFlag' 
----------------------------------------
ERROR: Command errored out with exit status 1: /home/tyler/.cache/pypoetry/virtualenvs/gram-D8nqyLvp-py3.8/bin/python /home/tyler/.cache/pypoetry/virtualenvs/gram-D8nqyLvp-py3.8/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ijw94hfl/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 40.8.0' wheel Check the logs for full command output.  

here is my pyproject.toml:

[tool.poetry]
name = "gram"
version = "0.1.0"
description = ""
authors = ["Tyler Schlichenmeyer <tyler.schlichenmeyer@gmail.com>"]
license = "MIT"

[tool.poetry.dependencies]
python = "3.8.3"
whitenoise = "^5.1.0"
pandas = "^1.0.5"
pygsheets = "^2.0.3"
gunicorn = "^20.0.4"
dash = "^1.14.0"
dash-bootstrap-components = "0.10.3"
python-dotenv = "^0.14.0"

[tool.poetry.dev-dependencies]
pylint = "^2.5.3"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

when i switch DBC version from 10.3 to 10.5 and run poetry update it causes the error

@schlich schlich reopened this Aug 21, 2020
@schlich
Copy link
Author

schlich commented Aug 21, 2020

looks like this may be related to #401

@tcbegley tcbegley added the bug Something isn't working label Aug 22, 2020
@tcbegley
Copy link
Collaborator

tcbegley commented Aug 22, 2020

Thanks for reporting, I can recreate this with your pyproject.toml. I don't quite understand what's going on yet, but I'm looking into it. I'm also working on some improvements to the way we build the package which I'm hoping will address #401 and possibly also this, will try to prioritise that.

@tcbegley
Copy link
Collaborator

tcbegley commented Sep 1, 2020

Hey @schlich

I've made some changes to the way we build packages and just made a prerelease.

I am now not seeing problems anymore if I set the dash-bootstrap-components version in your pyproject.toml to 0.10.6rc1. If you have a moment would you be able to check if the same is true for you? I'll push out a full release in the next few days.

@schlich
Copy link
Author

schlich commented Sep 3, 2020

@tcbegley

ran poetry update with no problems.

@tcbegley
Copy link
Collaborator

This should now be resolved as of 0.10.6. Feel free to re-open if you encounter more problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants