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

launching AlphaPept GUI failed #564

Open
Chuanping-Zhao opened this issue Sep 9, 2024 · 1 comment
Open

launching AlphaPept GUI failed #564

Chuanping-Zhao opened this issue Sep 9, 2024 · 1 comment

Comments

@Chuanping-Zhao
Copy link

Describe the bug
When attempting to start the AlphaPept GUI using Streamlit, an AttributeError is raised related to the numpy.typing module not having an attribute NDArray. This error prevents the AlphaPept GUI from launching correctly.

To Reproduce
Steps to reproduce the behavior:
Activate the Conda environment with conda activate alphapept.
conda activate alphapept
Run alphapept gui.
alphapept gui
The GUI initialization begins and loads several modules.
The error occurs during the import sequence, particularly when importing PIL (Python Imaging Library) which in turn requires numpy.typing.NDArray, leading to a crash.
AttributeError: module 'numpy.typing' has no attribute 'NDArray' Traceback: File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling result = func() File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 590, in code_to_exec exec(code, module.__dict__) File "D:\softwares_pathway\Anaconda3\envs\alphapept\Lib\site-packages\alphapept\webui.py", line 2, in <module> from alphapept.gui import history, results, filewatcher, status, experiment, fasta, start, constants File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\alphapept\gui\history.py", line 4, in <module> import plotly.express as px File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\plotly\express\__init__.py", line 14, in <module> from ._imshow import imshow File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\plotly\express\_imshow.py", line 8, in <module> from plotly.utils import image_array_to_data_uri File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\plotly\utils.py", line 5, in <module> from _plotly_utils.data_utils import * File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\_plotly_utils\data_utils.py", line 6, in <module> from PIL import Image File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\PIL\Image.py", line 68, in <module> from ._typing import StrOrBytesPath, TypeGuard File "D:\softwares_pathway\Anaconda3\envs\alphapept\lib\site-packages\PIL\_typing.py", line 10, in <module> NumpyArray = npt.NDArray[Any]
image

Expected behavior
I expected the AlphaPept GUI to launch and operate without any import errors or crashes, allowing for typical usage such as file management and experiment handling within the interface.

Version
Windows 11
Version: AlphaPept 0.5.3
Installation Type: Conda environment

@volvox292
Copy link

Same issue here when trying to build the docker container and trying to start, on linux.

FROM jupyter/base-notebook:python-3.8

USER root

RUN apt-get update
&& apt-get install -y --no-install-recommends
apt-utils
build-essential
libgomp1
gnupg
ca-certificates
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
&& echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
&& apt update
&& apt install -y mono-devel
&& wget https://github.com/MannLabs/alphapept/blob/master/alphapept/ext/bruker/FF/linux64/libtbb.so.2
&& mv libtbb.so.2 /usr/lib/

RUN conda install -c anaconda pytables==3.6.1
RUN conda install -c conda-forge pythonnet>=2.5.0
RUN conda install -c conda-forge numba==0.55.2 numpy==1.20.3 pandas==1.4.3 cupy

RUN pip install "alphapept[stable,gui-stable]"

CMD ["bash"]

docker run --gpus=all -p 8505:8505 -v /mnt/ultra/alphapept/docker:/home/alphapept/ docker-alphapept:latest alphapept gui
then trying to access the webservice I get this error:

2025-03-06 09:05:13.523 Uncaught app exception
Traceback (most recent call last):
File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
exec(code, module.dict)
File "/opt/conda/lib/python3.8/site-packages/alphapept/webui.py", line 2, in
from alphapept.gui import history, results, filewatcher, status, experiment, fasta, start, constants
File "/opt/conda/lib/python3.8/site-packages/alphapept/gui/history.py", line 4, in
import plotly.express as px
File "/opt/conda/lib/python3.8/site-packages/plotly/express/init.py", line 25, in
from ._imshow import imshow
File "/opt/conda/lib/python3.8/site-packages/plotly/express/_imshow.py", line 8, in
from plotly.utils import image_array_to_data_uri
File "/opt/conda/lib/python3.8/site-packages/plotly/utils.py", line 5, in
from _plotly_utils.data_utils import *
File "/opt/conda/lib/python3.8/site-packages/_plotly_utils/data_utils.py", line 6, in
from PIL import Image
File "/opt/conda/lib/python3.8/site-packages/PIL/Image.py", line 68, in
from ._typing import StrOrBytesPath, TypeGuard
File "/opt/conda/lib/python3.8/site-packages/PIL/_typing.py", line 10, in
NumpyArray = npt.NDArray[Any]
AttributeError: module 'numpy.typing' has no attribute 'NDArray'

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