Giter Site home page Giter Site logo

Comments (5)

aureliocirella avatar aureliocirella commented on September 16, 2024 2

As suspected, Python wasn't importing the module correctly. That is because I had a file in my working directory called "oci.py".
I discovered which module python was importing by print(oci).

Renaming that file made oci module being correctly imported again.

Thanks for the help and sorry for the inconvenience.

from oci-python-sdk.

aureliocirella avatar aureliocirella commented on September 16, 2024 1

I'm trying both from virtualenv and system wide libraries.
I've tried several times installing the OCI package from a local folder (downloading it from Github) but without success.

Other Python packages are working fine. Hence I don't think that my Python installation/libraries are corrupted.
In your knowledge, is there a way to check if the OCI package has been installed correctly? And what is the package that get imported?

from oci-python-sdk.

jyotisaini avatar jyotisaini commented on September 16, 2024

Hi @aureliocirella I do not see that we made this change. Was this code working before and it stopped working ?

Can you try importing like this. This is working for us.

from oci.config import from_file
oci_config = from_file(file_location="~/.oci/config", profile_name="DEFAULT")

from oci-python-sdk.

aureliocirella avatar aureliocirella commented on September 16, 2024

Hi, exactly. The problem came up suddenly, in the previous days it was working correctly.

Here's my code:

import oci
from oci.config import from_file
config = from_file(profile_name="PROFILE")

But I get the error:

Traceback (most recent call last):
  File "compartment-explorer.py", line 2, in <module>
    from oci.config import from_file
ModuleNotFoundError: No module named 'oci.config'; 'oci' is not a package

This is the output of pip3 list:

pip3 list | grep oci           
oci                2.112.1

Let me know if I can provide further proof.

Thank you.

from oci-python-sdk.

jyotisaini avatar jyotisaini commented on September 16, 2024

@aureliocirella Are you running your script inside virtualenv ? It looks like the error this time is different. It's not even recognizing 'oci' as a package. I would guess there is something wrong how the oci is installed and setup.

from oci-python-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.