pydomo - ImportError: cannot import name 'Sorting'
Hi. I am Japanese.
I am using pydomo0.12 on Python3.6.0 & jupyter1.0.0.
As for the question, I get an ImportError of 'Sorting'.
Could you tell me how to solve this?
Thanks.
from pydomo import Domo
from pydomo.datasets import DataSetRequest, Schema, Column, ColumnType, Policy
from pydomo.datasets import PolicyFilter, FilterOperator, PolicyType,Sorting
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-20-b1dbf454ea18> in <module>()
1 from pydomo import Domo
2 from pydomo.datasets import DataSetRequest, Schema, Column, ColumnType, Policy
----> 3 from pydomo.datasets import PolicyFilter, FilterOperator, PolicyType,Sorting
4
5 import logging
ImportError: cannot import name 'Sorting'
Comments
-
Anyway,I solved to enter either value directly,not import Sorting.
#dataset_list = list(datasets.list(sort=Sorting.NAME))
dataset_list = list(datasets.list(sort='lastUpdated',offset=10,limit=10))
If you know how to solve the import error please let me know.
0 -
You are importing the Sorting class correctly, but the failure is strange. I've had trouble replicating the issue. You may want to uninstall/reinstall pydomo and make sure you use `pip3 install pydomo`, as pydomo has only been tested with Python3.
Here is the import statement for the Sorting class:
from pydomo.datasets import Sorting
Once imported, you may use the Sorting class as an enum, with the following values:
class Sorting:
CARD_COUNT = 'cardCount'
DEFAULT = None
NAME = 'name'
STATUS = 'errorState'
UPDATED = 'lastUpdated'Thus, sorting by name would be "Sorting.NAME". Entering the string manually will have the same effect.
0 -
Thank you for your reply.
I tried to uninstall/reinstall, but I got another error.
Maybe,There is something wrong with my environment.
I will create a new environment by virtualenv and try again.---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-3-0a5b327573cd> in <module>()
----> 1 from pydomo import Domo
2 from pydomo.datasets import DataSetRequest, Schema, Column, ColumnType, Policy
3 #from pydomo.datasets import PolicyFilter, FilterOperator, PolicyType,Sorting
4 from pydomo.datasets import PolicyFilter, FilterOperator, PolicyType
5
/home/my_username/miniconda3/lib/python3.6/site-packages/pydomo/__init__.py in <module>()
----> 1 from pydomo.Transport import DomoAPITransport
2 from pydomo.datasets import DataSetClient
3 from pydomo.groups import GroupClient
4 from pydomo.streams import StreamClient
5 from pydomo.users import UserClient
/home/my_username/miniconda3/lib/python3.6/site-packages/pydomo/Transport.py in <module>()
4 import requests
5 import json
----> 6 from requests_toolbelt.utils import dump
7
8
ModuleNotFoundError: No module named 'requests_toolbelt'0 -
Hi user06158,
I added "requests_toolbelt" as a dependency to the python SDK. I made some updates on Friday and published a new version of the SDK.
To install 'requests_toolbelt, use `pip3 install requests_toolbelt`. Also, the error "ModuleNotFoundError" means a dependency is missing, and the solution is often installing the said missing module via Pip3.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive