watson-developer-cloud / python-sdk

:snake: Client library to use the IBM Watson services in Python and available in pip as watson-developer-cloud
https://pypi.org/project/ibm-watson/
Apache License 2.0
1.46k stars 827 forks source link

Fail to import 'ClassificationOptions' from 'ibm_watson.natural_language_understanding_v1' in py3.7 #827

Closed Fred-Fan closed 1 year ago

Fred-Fan commented 1 year ago

Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see Stack Overflow.

Before you open an issue, please check if a similar issue already exists or has been closed before.

Check service status

  1. For service issues or 5xx errors, first, go to the IBM Cloud status page and check the status of the service.
  2. If the service status is OK, continue with a bug report.


Overview I am trying the APIs for NLU using ibm_watson. However, the below import works in python 3.9 but failed in python 3.7

from ibm_watson.natural_language_understanding_v1 import ClassificationOptions

Expected behavior The component can be imported successfully

Actual behavior I got an error below:

Python 3.7.12 (default, Mar 23 2022, 17:57:27) 
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ibm_watson
>>> ibm_watson.__version__
'6.1.0'
>>> from ibm_watson.natural_language_understanding_v1 import ClassificationOptions
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'ClassificationOptions' from 'ibm_watson.natural_language_understanding_v1' (/Users/xuanchengfan/.pyenv/versions/3.7.12/lib/python3.7/site-packages/ibm_watson/natural_language_understanding_v1.py)
>>> 

How to reproduce

import ibm_watson
from ibm_watson.natural_language_understanding_v1 import ClassificationOptions

Screenshots If applicable, add screenshots to help explain your problem.

SDK Version '6.1.0'

Additional information:

Additional context my IBM email: xuancheng.fan@ibm.com