Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 1 3

AttributeError: module 'config' has no attribute 'ConfigurationSet

Hi,

I'm getting this error

AttributeError: module 'config' has no attribute 'ConfigurationSet

when trying

import refinitiv.dataplatform.eikon as ek

In python IDLE shell 3.9.4. any help is appreciated.

thanks

python
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
17k 80 39 63

Hi @nick.zincone

I want to confirm where the specific issues/successes are.

  1. You are unable to import the refinitiv.dataplatform lib within a python IDLE shell
    • Can you try importing the eikon package: "import eikon as ek"
  2. You can import the refinitiv.dataplatform lib within Jupyter Notebook
  3. Within Jupyter Notebook it freezes when you call get_timeseries()

Regarding #3, can you use the get_data() call?

Can you compare the versions of the python packages you have within your environment(s) and CodeBook? You can see what packages are installed within CodeBook by opening the "Libraries&Extension" file.

Were you ever successful at running your applications outside of CodeBook? Seems we may have environmental issues that we need to hunt down.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

import eikon as ek is the solution to avoid the AttributeError: module 'config' has no attribute 'ConfigurationSet in IDLE

Upvotes
17k 80 39 63

Hi @Mohammad.Alsele

Can you ensure you are using the latest version of the refinitiv.dataplatform package?

pip install --upgrade refinitiv.dataplatform

I just downloaded Python 3.9.4 and create a single cell that contains:

import refinitiv.dataplatform.eikon as ek

And did not observe any error.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 1 1 3

Thanks @nick.zincone

Unfortunately, that didn't help. The package was up to date. I switched to using jupyter notebook, which does not return this error. However, something else is wrong because a simple get_timeseries with one commodity and one month period does not return any results. it stays in execution for a long time that I have to kill it.

The same three lines run without any problem in the Eikon CodeBook app.


1635406444704.png



1635406444704.png (16.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 1 1 3

Thanks @nick.zincone for following up. I really appreciate you taking the time for this.

Here's my response point-wise:

1- Confirmed. I cannot import refinitiv.dataplatform or refinitiv.dataplatform.eikon in Python IDLE and I receive the error AttributeError: module 'config' has no attribute 'ConfigurationSet'

  • In IDLE: Import eikon as ek works (I had to install eikon from pip, I didn't realise it was not installed...) Anyway. Even after installing eikon from pip, import refinitiv.dataplatform does not work in IDLE
  • However (still in IDLE) with eikon imported I can now run my app and get_timeseries returns the expected results
  • In summary import refinitive.dtaplatform does not work. But import eikon works

2 & 3- Confirmed. Jupyter does not return the AttributeError mentioned above and freezes. I have looked in the log of jupyter and there are several error messages and warnings and they seem related to tornado package. See attached a copy of the log. The main issues I see are:

  • AttributeError: 'WebSocketProtocol13' object has no attribute 'is_closing'
  • WebSocket ping timeout after 120025 ms

I have compared the packages installed on my machine vs. what is loaded in the libraries&extensions file yesterday and installed all of them to the same version in CodeBook or a later one if available on pypi.

Finally, I was only successful in running the app outside CodeBook today after installing and importing eikon as ek in IDLE. otherwise it did not work.

Thanks again.

jupyter log.txt



jupyter-log.txt (6.8 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1.3k 3 2 4

Hi @Mohammad.Alsele ,

Could you check python-configuration lib version with "pip show python-configuration" command ?

You shoud have 0.8.2 version:

1635525142455.png

If it is not the case (or if you don't have any version), you can install/upgrade manually :
pip install --upgrade python-configuration



1635525142455.png (22.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 1 1 3

Thanks @pf

It is 0.8.2.

I tried ipython and I have no problems there. The issue seems to only be with jupyter (both notebook and lab)

Maybe an important detail that I have not mention. I am not using a conda installation. I installed python as standalone software and all packages are installed/maintained with pip


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

About your comment about conda : it isn't mandatory, you can manage standalone python software and install packages with pip.

Upvotes
1.3k 3 2 4

If you have several python environments, did you check that your jupyter is using the right one ?
You can control easily in Jupyter with same command in a cell:

1635526227505.png



1635526227505.png (21.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @pf ,

There appears to be a couple of problems here. The first one is related to the config error - which is what you are addressing here - but that error occurs within a Python IDLE environment. The 2nd is the freezing within the Jupiter environment. There is no ‘config’ issue in the Jupiter env based on what has been reported.

Thanks guys, indeed as @nick.zincone pointed out there is no issue with configurations in jupyter. python-configurations there are the right version (0.8.2)

Upvotes
3 1 1 3

Thanks @pf and @nick.zincone for your effort to help me out. Since it's been a few days with this issue and it has, maybe, been complicated with different issues that I raised. So, I'll summarise the latest status. hopefully, clarifying the key issues here to anyone who would want to help .

1- Python IDLE

  • import refinitiv.dataplatform.eikon as ek does not work. raises the error specified in the first message of this thread
  • Import eikon as ek works fine.

2- ipython

  • works fine for both import refinitive.dataplatform.eikon and import eikon

3- Jupyter notebook

  • There is no config error when importing refinitive.dataplatform.eikon or eikon
  • However, it does not work, kernel freezes and no results are returned.
  • From jupyter logs it seems the kernel goes idel and that seems to be because of Tornado
  • the error that I keep seeing is "tornado.util.TimeoutError: Timeout"


Since import eikon in IDLE works fine, I don't need help figuring out what's the issue with refinitive.dataplatform.eikon is.

What I need help with is getting jupyter to work proplery. considering this question was started in relation to IDLE and the configuration issue and that was avoided by the use of import eikon, I will close this thread and start a new question for the issue with jupyter.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
176 2 1 5

Hi @Mohammad.Alsele I think I have the solution why it works everywhere except in your IDE.

the refinitiv dataplatform has an issue where it imports a config class. Which is fine of course, but the problem is that it searches ANYWHERE in the directory for a config.py file. If you happen to have your own config.py file (might be from another package), then refinitiv will use YOUR config.py file, instead of its own config class. of course that will crash, saying "module 'config' has no attribute 'ConfigurationSet'".

the solution is to remame your own config.py file.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks @valstar for picking this up. which directory do you refer to? the one where the jupyter notebook is running or different one?
Upvote
176 2 1 5

what i am saying is that you should take a good look in the directory where your python file that you are running resides, and look for config.py files.

in my case, i am using pycharm, my own config.py file resided in the same dir as my python file i wanted to run

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks @valstar , there are no config files in the directory where I'm running my code.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.