Forum Stats

  • 3,769,004 Users
  • 2,252,898 Discussions
  • 7,874,837 Comments

Discussions

oml4py error interface between python + oracle database

user5716448
user5716448 Member Posts: 1,742 Silver Badge
edited Mar 2, 2020 7:01AM in Python

Hi,

Have ran pip install oml4py and tried to import oml in jupyter but get message below.

import oml

--------------------------------------------------------------------------- ModuleNotFoundError                       Traceback (most recent call last) <ipython-input-1-2d3e0058174b> in <module>() ----> 1 import oml  ModuleNotFoundError: No module named 'oml'

Any thoughts on how to resolve to allow us to use oml4py

Thanks

Answers

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,784 Bronze Crown
    edited Aug 9, 2019 9:42PM

    With your brief description of the issue its hard to say. Here's some links that might help

    https://pypi.org/project/oml4py/

    https://towardsdatascience.com/oracle-machine-learning-for-python-e335fc0a50e8

    Try getting a simple pyhon script working (without involving jupyter) to verify your python and oml4py install.

    user5716448
  • user5716448
    user5716448 Member Posts: 1,742 Silver Badge
    edited Aug 12, 2019 8:52AM

    Thanks for update.

    Had been trying below from your 2nd link in jupyter

    import oml

    from oml.automl import ModelTuning

    from oml import algo

    import config

    # connection to Oracle DB...

    oml.connect(config.USER,config.PWD,

    '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=1521))(CONNECT_DATA=(service_name=<SID>)))',

    automl=True)

    # test if connected

    oml.isconnected()

    # create an OML dataframe connected to DB table

    <table> = oml.sync(table = '<table>')

    uleNotFoundError  Traceback (most recent call last)

    <ipython-input-2-140bf7774210> in <module>()

    ----> 1 import oml

      2 from oml.automl import ModelTuning

      3 from oml import algo

      4 import config

      5

    ModuleNotFoundError: No module named 'oml'

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,784 Bronze Crown
    edited Aug 12, 2019 11:59PM

    Apologies, all I can offer is another link. This will help you "debug" where your python install looks for packages. Hopefully this will help:

    https://leemendelowitz.github.io/blog/how-does-python-find-packages.html

    user5716448
  • user5716448
    user5716448 Member Posts: 1,742 Silver Badge
    edited Aug 13, 2019 4:34AM

    No problem - thanks for link

  • Muthu_SM-Oracle
    Muthu_SM-Oracle Member Posts: 1
    edited Nov 6, 2019 5:20AM

    Facing the same issue with Python 3.7 (which is mentioned as the pre-reg for OML)

    Did anyone resolve this issue when we import oml ??

    >>> import oml

    Traceback (most recent call last):

      File "<stdin>", line 1, in <module>

    ModuleNotFoundError: No module named 'oml'

    already oml installed successfully .. Verified the same here

    (base) C:\WINDOWS\system32>pip install oml

    Requirement already satisfied: oml in c:\\  \appdata\local\continuum\anaconda3\lib\site-packages (0.1.2)

    Requirement already satisfied: quik in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from oml) (0.2.2)

    Requirement already satisfied: requests in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from oml) (2.22.0)

    Requirement already satisfied: lupa in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from oml) (1.8)

    Requirement already satisfied: idna<2.9,>=2.5 in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from requests->oml) (2.8)

    Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from requests->oml) (3.0.4)

    Requirement already satisfied: certifi>=2017.4.17 in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from requests->oml) (2019.9.11)

    Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\\ \appdata\local\continuum\anaconda3\lib\site-packages (from requests->oml) (1.24.2)

  • Sherry Lamonica-Oracle
    Sherry Lamonica-Oracle Posts: 438 Employee
    edited Nov 20, 2019 1:22PM

    Try setting the environment variable PYTHONPATH to the location of the installed packages.  For example:

    $ export PYTHONPATH=$ORACLE_HOME/oml4py/modules

    Sherry

    user5716448
  • user5716448
    user5716448 Member Posts: 1,742 Silver Badge
    edited Nov 21, 2019 11:58AM

    Thanks for update

  • gsalem-Oracle
    gsalem-Oracle Posts: 144 Employee
    edited Mar 2, 2020 7:01AM

    Just to clarify things: the OML4PY you pointed to has nothing to do with Oracle, or with the similarly named module from Oracle. Not sure how this naming conflict will be resolved.