Giter VIP home page Giter VIP logo

Comments (17)

oleole39 avatar oleole39 commented on September 15, 2024 18

Same issue here as the one pictured and solved by kuirolo hereinabove although there seems to be a typo in what @kuirolo & @sh4yce mention at the final step of the fix (it is werkzeug and not workzeug).

To sum up, I was able to run excalibur initdb and excalibur webserver successfully after doing the following:

  1. pip install -U configparser
  2. pip install -U flask
  3. Replace line 10 of {ROOT_TO_PYTHON_FOLDER}/python3.10/site-packages/excalibur/www/views.py with from werkzeug.utils import secure_filename (i.e. overwriting previous line containing from werkzeug import secure_filename)

from excalibur.

kuirolo avatar kuirolo commented on September 15, 2024 2

Apologies if this is a lot of terminal dumps and not a lot of pull requests. I'm fairly new to contributing.

This seems partly related to issue #152 which I had on python 3.8 with similar ImportErrors.

On python 3.10, starting from a fresh venv I had the following chain of ImportErrors while trying to run excalibur initdb, the first few were resolved by updated the importing package as @Andrflor suggested.

TL;DR: this issue might be resolved by moving up some of the version requirements in setup.py, and changing an import call in excalibur.www.views

Here's what happend for me:

(venv) $ pip install excalibur
(venv) $ excalibur initdb
...
  File "/home/kuirolo/.venv/excal310/lib64/python3.10/site-packages/excalibur/configuration.py", line 7, in <module>
    from backports.configparser import ConfigParser
  File "/home/kuirolo/.venv/excal310/lib64/python3.10/site-packages/backports/configparser/__init__.py", line 130, in <module>
    from collections import MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
(venv) $ pip install -U configparser # Move from 3.5.2 to 5.2.0

With option captial -U this resolved @muralikodali 's issue for me.

(venv) $ excalibur initdb
...
  File "/home/kuirolo/.venv/excal310/lib64/python3.10/site-packages/excalibur/www/app.py", line 3, in <module>
    from flask import Flask, Blueprint
  File "/home/kuirolo/.venv/excal310/lib64/python3.10/site-packages/flask/__init__.py", line 14, in <module>
   from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (/home/kuirolo/.venv/excal310/lib64/python3.10/site-packages/jinja2/__init__.py)
(venv) $ pip install -U flask # Move from flask 1.1.2 to 2.1.1 and from werkzeug 0.16.1 to 2.1.1

This is an upstream issue with flask 1.1.0, so it is resolved by upgrading. I also had this issue on python 3.8 after resolving issue #152 .

(venv) $ excalibur initdb
...
  File "/home/kuirolo/.venv/excal310/lib64/python3.10/site-packages/excalibur/www/app.py", line 7, in <module>
    from .views import views
  File "/home/kuirolo/.venv/excal310/lib64/python3.10/site-packages/excalibur/www/views.py", line 10, in <module>
    from werkzeug import secure_filename
ImportError: cannot import name 'secure_filename' from 'werkzeug' (/home/kuirolo/.venv/excal310/lib64/python3.10/site-packages/werkzeug/__init__.py)

Here I think the solution is changing the excalibur.www.views import call to reflect the refactoring of workzeug in 2.1.1. According to this stackoverflow secure_filename now has to be imported using from workzeug.utils import secure_filename.

I'll take a crack at fixing this tomorrow if I have time.

[Edited for clarity and terminal formatting]

from excalibur.

scaggio avatar scaggio commented on September 15, 2024 1

Same error of @muralikodali (ImportError: cannot import name 'MutableMapping' from 'collections'). I tried to follow your suggestions (@oleole39 ) but i couldn't solve the issue. It raises me this error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\giosc\anaconda3\envs\data_analysis\Scripts\excalibur.exe\__main__.py", line 4, in <module>
  File "C:\Users\giosc\anaconda3\envs\data_analysis\Lib\site-packages\excalibur\cli.py", line 10, in <module>
    from .tasks import split, extract
  File "C:\Users\giosc\anaconda3\envs\data_analysis\Lib\site-packages\excalibur\tasks.py", line 13, in <module>
    from camelot.ext.ghostscript import Ghostscript
ModuleNotFoundError: No module named 'camelot.ext'

but the way i have: camelot-py==0.11.0

While upgrading configparser and flask it raised me this:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. excalibur-py 0.4.3 requires configparser<3.6.0,>=3.5.0, but you have configparser 6.0.0 which is incompatible. excalibur-py 0.4.3 requires Werkzeug<1.0.0, but you have werkzeug 3.0.1 which is incompatible

I have python 3.11.5

from excalibur.

Philippe-M avatar Philippe-M commented on September 15, 2024

Hello, i've the same problem

from excalibur.

Andrflor avatar Andrflor commented on September 15, 2024

You have an outdated version of configparser using a deprecated call that has been removed in python 3.10.
Using pip for example you can update with:

pip install configparser -U

As a rule of thumb, try to keep you packages updated to prevent this kind of issues.

from excalibur.

muralikodali avatar muralikodali commented on September 15, 2024

pip install configparser -u giving the following output :

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: configparser in /home/murali/.local/lib/python3.10/site-packages (5.2.0)

Above error ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py) is shown again.

from excalibur.

Andrflor avatar Andrflor commented on September 15, 2024

You have two install of configparser.

Look the path

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: configparser in /home/murali/.local/lib/python3.10/site-packages (5.2.0)

Above error ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py) is shown again.

One is : /usr/lib/python3.10/
And the other is : /home/murali/.local/lib/python3.10/

You can check the versions of the packages installed with:
pip freeze for root packages
and pip freeze --user for your user.

I guess that pip freeze --user will give you the latest 5.2.0
And the pip freeze has an outdated version.

(If you are not familiar with bash you can use grep to locate a package for example you can do)
pip freeze | grep configparser

I think you may need to update the root package and not the local one to make it work.
sudo pip install configparser -U

If it does not work, i'm curious to see full outputs of both of your pip freeze...

from excalibur.

muralikodali avatar muralikodali commented on September 15, 2024

i have installed configparser-5.2.0 with pip install --upgrade configparser, but excalibur is showing lower version requirement for configparser.

Successfully uninstalled configparser-3.5.3
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
excalibur-py 0.4.3 requires configparser<3.6.0,>=3.5.0, but you have configparser 5.2.0 which is incompatible.
Successfully installed configparser-5.2.0

from excalibur.

Andrflor avatar Andrflor commented on September 15, 2024

My current config on python 3.10 root packages

excalibur-py==0.4.3
  - camelot-py [required: >=0.7.1, installed: 0.9.0]
...
  - configparser [required: >=3.5.0,<3.6.0, installed: 5.2.0]
...

As you can see i have configparser 5.2.0 even if the requirement says >=3.5.0,<3.6.0 and it's working like a charm...
Is it working for you?

Still, a configparser requirement version update is needed...

from excalibur.

MKuranowski avatar MKuranowski commented on September 15, 2024

Updating cofigparser unravels another dependency issue with itsdangerous; which in turn needs to be downgraded to 2.0.1.

Traceback (most recent call last):
  File "/home/mikolaj/Desktop/tables/excalibur/bin/excalibur", line 5, in <module>
    from excalibur.cli import cli
  File "/home/mikolaj/Desktop/tables/excalibur/lib/python3.10/site-packages/excalibur/cli.py", line 12, in <module>
    from .www.app import create_app
  File "/home/mikolaj/Desktop/tables/excalibur/lib/python3.10/site-packages/excalibur/www/app.py", line 3, in <module>
    from flask import Flask, Blueprint
  File "/home/mikolaj/Desktop/tables/excalibur/lib/python3.10/site-packages/flask/__init__.py", line 19, in <module>
    from . import json
  File "/home/mikolaj/Desktop/tables/excalibur/lib/python3.10/site-packages/flask/json/__init__.py", line 15, in <module>
    from itsdangerous import json as _json
ImportError: cannot import name 'json' from 'itsdangerous' (/home/mikolaj/Desktop/tables/excalibur/lib/python3.10/site-packages/itsdangerous/__init__.py)

from excalibur.

echidne avatar echidne commented on September 15, 2024

@kuirolo I'm stuck at the same step than you => did you find a work around?

from excalibur.

sh4yce avatar sh4yce commented on September 15, 2024

Did this ever get fixed?
Having the same issue

EDIT: @kuirolo was correct in his next steps. I fixed it by changing view.py on the line importing secure_filename from workzeug (which should be from workzeug.utils)

from excalibur.

dmil avatar dmil commented on September 15, 2024

+1 having the same issue

from excalibur.

kilojulius avatar kilojulius commented on September 15, 2024

@oleole39 Thanks! That worked well for me!

from excalibur.

floriandierickx avatar floriandierickx commented on September 15, 2024

Wonderful, thanks @oleole39 for the solution :)

A small addition for those who happen to work in an anaconda environment, the file location of step 3 is then:

C:\Users\{USERNAME}\AppData\Local\anaconda3\Lib\site-packages\excalibur\www\views.py

from excalibur.

oleole39 avatar oleole39 commented on September 15, 2024

@scaggio

but i couldn't solve the issue. It raises me this error:

Not sure about the issue, but I guess a good start would be to solve the issue that seems to be caused by the dependencies' versions.
To give you an indication, I run excalibur sucessfully with Python 3.10.12 and:

camelot-py==0.9.0
click==8.1.3
celery==5.2.7
configparser==5.3.0
Flask==1.1.2
SQLAlchemy==1.4.42
Werkzeug==1.0.1

(you can downgrade packages by specifying exact version you want to install pip install configparser==5.3.0. But if you are using the packages for other uses, you might experience issues with them. To avoid that install excalibur using a python virtual environement)

from excalibur.

sd3ntato avatar sd3ntato commented on September 15, 2024

hi

another dockerized and fixed version here #183

it not perfect but at least can use the app

from excalibur.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.