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

ImportError: cannot import name 'put_scope' from 'pywebio.output' #1

Open
rvhewitt opened this issue Apr 5, 2022 · 4 comments
Open

Comments

@rvhewitt
Copy link

rvhewitt commented Apr 5, 2022

I am unable to run Foliage 1.2.4 due to an import error.
Installed via pipx

C:\windows\system32>foliage
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\rhewitt.local\bin\foliage.exe_main
.py", line 4, in
File "C:\Users\rhewitt.local\pipx\venvs\foliage\lib\site-packages\foliage_main
.py", line 166, in
from foliage.change_tab import ChangeTab
File "C:\Users\rhewitt.local\pipx\venvs\foliage\lib\site-packages\foliage\change_tab.py", line 26, in
from pywebio.output import put_column, put_scope, clear_scope
ImportError: cannot import name 'put_scope' from 'pywebio.output' (C:\Users\rhewitt.local\pipx\venvs\foliage\lib\site-packages\pywebio\output.py)

Regards, rvhewitt

@mhucka
Copy link
Member

mhucka commented Apr 7, 2022

Hi – it might be that recent versions of pywebio have changed. I ended up using a private copy because I had to make a couple of changes to make it all work. I should probably put up a fork of pywebio if people are actually going to try to use Foliage outside of our group!

@mhucka
Copy link
Member

mhucka commented Apr 15, 2022

Update: after spending some time on this, I think it would be difficult for other users to deal with a fork of PyWebIo. So, I'm going to work on submitting pull requests to the PyWebIo maintainers for the changes I made, to try to get them into the main release.

@rvhewitt
Copy link
Author

Thank you, that will be much appreciated.

@mhucka
Copy link
Member

mhucka commented May 12, 2022

Update: I finally found at least a temporary solution to the problem with PyWebIO. I created a fork of a snapshot of the PyWebIO GitHub repository and put my (very few) changes in it. Now the installation can be done using a 2-step approach:

python3 -m pip install git+https://github.com/mhucka/PyWebIO.git@2af53fc
python3 -m pip install foliage

However, in working on this, I realized that it may not be that easy to use Foliage at a non-Caltech site, because of baked-in assumptions about Caltech's FOLIO contents and identifier patterns used in FOLIO records :-). So, while it should be possible to install and start Foliage now, it will probably not do much for most people until those assumptions are moved to some kind of configuration file. I'm sorry about that. I'll open an issue to remind us that this is a problem, but I'm not sure when we will be able to get to fixing it.

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

No branches or pull requests

2 participants