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

installation--> import error #117

Open
gfudenberg opened this issue Apr 5, 2023 · 6 comments · Fixed by higlass/higlass-schema#9
Open

installation--> import error #117

gfudenberg opened this issue Apr 5, 2023 · 6 comments · Fixed by higlass/higlass-schema#9

Comments

@gfudenberg
Copy link

just tried pip installing into the open2c environment and am getting the following:

import higlass as hg
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In [5], line 1
----> 1 import higlass as hg

File ~/.conda/envs/open2c/lib/python3.8/site-packages/higlass/__init__.py:8
      5 except PackageNotFoundError:
      6     __version__ = "uninstalled"
----> 8 from higlass_schema import *
     10 import higlass.tilesets
     11 from higlass.api import *

File ~/.conda/envs/open2c/lib/python3.8/site-packages/higlass_schema/__init__.py:6
      3 except ImportError:
      4     __version__ = "unknown"
----> 6 from .schema import *

File ~/.conda/envs/open2c/lib/python3.8/site-packages/higlass_schema/schema.py:19
     17 from pydantic import BaseModel as PydanticBaseModel
     18 from pydantic import Extra, Field
---> 19 from pydantic.class_validators import root_validator
     20 from pydantic.generics import GenericModel as PydanticGenericModel
     21 from typing_extensions import Literal, TypedDict, Annotated

ModuleNotFoundError: No module named 'pydantic.class_validators'

Version info for higlass/pydantic:

conda list |grep higlass
higlass-python            1.0.0rc1                 pypi_0    pypi
higlass-schema            0.0.4                    pypi_0    pypi
higlass-widget            0.0.7                    pypi_0    pypi
conda list |grep pyd
pydantic                  2.0a1                    pypi_0    pypi
pydantic-core             0.22.0                   pypi_0    pypi
@gfudenberg gfudenberg changed the title import error installation--> import error Apr 5, 2023
@gfudenberg
Copy link
Author

gfudenberg commented Apr 6, 2023

pinned pydantic to 1.0

pydantic.version.VERSION
StrictVersion ('1.0')

However

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In [3], line 1
----> 1 import higlass as hg

File ~/.conda/envs/open2c/lib/python3.8/site-packages/higlass/__init__.py:8
      5 except PackageNotFoundError:
      6     __version__ = "uninstalled"
----> 8 from higlass_schema import *
     10 import higlass.tilesets
     11 from higlass.api import *

File ~/.conda/envs/open2c/lib/python3.8/site-packages/higlass_schema/__init__.py:6
      3 except ImportError:
      4     __version__ = "unknown"
----> 6 from .schema import *

File ~/.conda/envs/open2c/lib/python3.8/site-packages/higlass_schema/schema.py:23
     20 from pydantic.generics import GenericModel as PydanticGenericModel
     21 from typing_extensions import Literal, TypedDict, Annotated
---> 23 from .utils import exclude_properties_titles, get_schema_of, simplify_enum_schema
     24 import functools
     27 # Override Basemodel

File ~/.conda/envs/open2c/lib/python3.8/site-packages/higlass_schema/utils.py:3
      1 from typing import Any, Dict, TypeVar
----> 3 from pydantic import BaseModel, schema_of
      6 def simplify_schema(root_schema: Dict[str, Any]) -> Dict[str, Any]:
      7     """Lift defintion reference to root if only definition"""

ImportError: cannot import name 'schema_of' from 'pydantic' (/home1/fudenber/.conda/envs/open2c/lib/python3.8/site-packages/pydantic/__init__.py)

@sergpolly
Copy link

I went past the pydantic issues by using its last stable version v1.10.7
I guess it installs pydantic 2 because of the --pre flag in pip install

The higlass-python doesn't work for me still though...
There are no more errors, but it doesn't render even remote heatmaps

@manzt
Copy link
Member

manzt commented Apr 7, 2023

The higlass-python doesn't work for me still though...
There are no more errors, but it doesn't render even remote heatmaps

Yes, there seems to be an issue with the default HTML repr. I'll resolve this asap, but have limited time at the moment. As a workaround, you should be able to use the .widget() method to render the visualization as Jupyter Widget (instead of the default behavior).

import higlass as hg

# Remote data source (tileset)
tileset1 = hg.remote(
    uid="CQMd6V_cRw6iCI_-Unl3PQ",
    server="https://higlass.io/api/v1/",
    name="Rao et al. (2014) GM12878 MboI (allreps) 1kb",
)

# Local tileset
tileset2 = hg.cooler("../data/dataset.mcool")

# Create a `hg.HeatmapTrack` for each tileset
track1 = tileset1.track("heatmap")
track2 = tileset2.track("heatmap")

# Create two independent `hg.View`s, one for each heatmap
view1 = hg.view(track1, width=6)
view2 = hg.view(track2, width=6)

# Lock zoom & location for each `View`
view_lock = hg.lock(view1, view2)

# Concatenate views horizontally and apply synchronization lock
(view1 | view2).locks(view_lock).widget()

or

view1.widget()

@sergpolly
Copy link

.widget() works indeed ! Thank you !

@manzt manzt mentioned this issue Apr 20, 2023
5 tasks
@manzt
Copy link
Member

manzt commented Apr 20, 2023

Published a new release candidate which should fix the rendering issue (without .widget()). I think the biggest priority right now is trying to resolve cooler compatibility clodius (especially if you're using cooltools).

@sergpolly
Copy link

yez ! I've actually just tried to see if I can help with that higlass/clodius#150 ...

Since that issue, I've managed to run clodius tests and see tiles/coolper.py failures - that's a start ...

Unfortunately I don't know much about tiles-serving logic inside, so if you know what needs to be fixed even more specifically - that would help !

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

Successfully merging a pull request may close this issue.

3 participants