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

Opening display from a script #95

Open
wsnoble opened this issue Sep 7, 2022 · 4 comments
Open

Opening display from a script #95

wsnoble opened this issue Sep 7, 2022 · 4 comments

Comments

@wsnoble
Copy link

wsnoble commented Sep 7, 2022

I've got higlass working from within a Jupyter notebook, but the same code gives an error when I run it from a script. Is there something different that needs to be done for non-jupyter notebook usage?

Here is the error:

Process Process-1:
Traceback (most recent call last):
  File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/site-packages/multiprocess/process.py", line 315, in _bootstrap
    self.run()
  File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/site-packages/multiprocess/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/site-packages/flask/app.py", line 1188, in run
    run_simple(t.cast(str, host), port, self, **options)
  File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/site-packages/werkzeug/serving.py", line 1069, in run_simple
    fd = int(os.environ["WERKZEUG_SERVER_FD"])
  File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'WERKZEUG_SERVER_FD'

And here is the code:

            my_array = sparse_matrix.toarray().astype(float)

            ts = Tileset(
                tileset_info=lambda: npmatrix.tileset_info(my_array),
                tiles=lambda tids: npmatrix.tiles_wrapper(my_array, tids)
            )

            display, server, viewconf = higlass.display([
                View([
                    Track(track_type='top-axis', position='top'),
                    Track(track_type='left-axis', position='left'),
                    Track(track_type='heatmap',
                          position='center',
                          tileset=ts,
                          height=500),

                ])
            ], fuse=False)
            display

I am running this on MacOS 12.5.1.

@LHXqwq
Copy link

LHXqwq commented Feb 14, 2023

Have your issue been resolved? I am facing the same problem.

Process Process-9:
Traceback (most recent call last):
File "/home/lihaoxing/miniconda3/envs/jupyter/lib/python3.9/site-packages/multiprocess/process.py", line 315, in _bootstrap
self.run()
File "/home/lihaoxing/miniconda3/envs/jupyter/lib/python3.9/site-packages/multiprocess/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/lihaoxing/miniconda3/envs/jupyter/lib/python3.9/site-packages/flask/app.py", line 1188, in run
run_simple(t.cast(str, host), port, self, **options)
File "/home/lihaoxing/miniconda3/envs/jupyter/lib/python3.9/site-packages/werkzeug/serving.py", line 1069, in run_simple
fd = int(os.environ["WERKZEUG_SERVER_FD"])
File "/home/lihaoxing/miniconda3/envs/jupyter/lib/python3.9/os.py", line 679, in getitem
raise KeyError(key) from None
KeyError: 'WERKZEUG_SERVER_FD'

@hepcat72
Copy link

+1 Same issue here.

@narzouni
Copy link

+1, I tried different versions of WERKZEUG too, but I am getting the same error.

@LiuJie1117
Copy link

I ran into the same problem, then I tried to downgrade my WERKZEUG to version 2.0.3, and it worked for me.

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

5 participants