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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
1 0 0 1

PyCharm vs Jupyter Notebook in eikon call

Hi guy

I tried to call Eikon library from my python with PyCharm but I received the follow message.

Intead if I use Jupyter Notebook with the same code it's ok.

Can anybody explain me why?

Thankyou very much.

PS I use Python 3.8 and Eikon 1.2.1





C:\Users\Denis\AppData\Local\Programs\Python\Python38\python.exe "C:/Users/Denis/Documents/Python Scripts/Ultimo16.11.2021.py"
2021-11-30 19:02:22,850 P[10756] [MainThread 3876] Error: no proxy address identified.
Check if Eikon Desktop or Eikon API Proxy is running.
2021-11-30 19:02:22,850 P[10756] [MainThread 3876] Port number was not identified, cannot send any request
2021-11-30 19:02:22,851 P[10756] [MainThread 3876] Port number was not identified.
Check if Eikon Desktop or Eikon API Proxy is running.
Traceback (most recent call last):
File "C:/Users/Denis/Documents/Python Scripts/Ultimo16.11.2021.py", line 2, in <module>
ek.set_app_key('da7a4b793dcf4459968a5cc095a80c1618e9cf2b')
File "C:\Users\Denis\AppData\Local\Programs\Python\Python38\lib\site-packages\eikon\Profile.py", line 33, in set_app_key
get_profile().set_app_key(app_key)
File "C:\Users\Denis\AppData\Local\Programs\Python\Python38\lib\site-packages\eikon\Profile.py", line 231, in set_app_key
self.check_profile()
File "C:\Users\Denis\AppData\Local\Programs\Python\Python38\lib\site-packages\eikon\Profile.py", line 354, in check_profile
raise EikonError(-1, 'Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.')
eikon.eikonError.EikonError: Error code -1 | Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.

api
icon clock
10 |1500

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

18 Answers

Upvotes
23k 22 9 14

Hello @Denis Dal Soler ,

The result for requesting Eikon Data API via PyCharm, in my understanding, should be consistent with the result from requesting Eikon Data API via Jupyter Notebook.

There can be a couple of reasons that I can think of, when the two would differ:

1. The environment is in flux. To eliminate this possibility, I would restart Eikon cleanly (restarting your machine if Eikon does not restart cleanly) and retesting several times each way, to make sure the results are consistent. I would verify this first.

2. The version of python being in use by PyVharm and by Jupyter Notebook differs, and is installed with different modules. I would verify which python is in use by PyCharm, which by Jupyter Notebook, and which versions of the modules are installed. If they differ, point PyCarm to use python env that Jupyter uses. I would verify this next.

I hope this helps, please let us know how this works on your side.

icon clock
10 |1500

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

Upvotes
21 0 0 1

Hello @Denis Dal Soler ,

There isn't 1.2.1 version for eikon lib, so I assume it's 1.1.2.
Whatever the version, you should try with the last one (1.1.14) because the python library is aligned with Eikon Desktop application and older version of eikon could become incompatible with desktop application.

icon clock
10 |1500

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

Upvotes
1 0 0 1

Hello @zoya faberov and @pf i've installed eikon 1.1.14 in PyCharm and now it's all ok. How can i install the same version for Jupyter Notebook? I'm not so grasped ...

Thankyou very much

icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hello @Denis Dal Soler ,

Are you using Jupyter with Anaconda? If that is the case, you can examine and update your environment via Anaconda GUI, see details Managing Anaconda packages.

Without Anaconda, Installing Python Packages from a Jupyter Notebook can be of help.

Hope this information helps

icon clock
10 |1500

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

Upvotes
1 0 0 1

Dear @zoya faberov I'm very grateful for your time.

In Anaconda I've installed Eikon 1.1.14 as @pf suggest. I can see now this version in anaconda enviroments. When I tried to run my code in Jupyter (from anaconda) I received this message (only an extract)

AttributeError                            Traceback (most recent call last)
<ipython-input-1-4cf288ccf9fd> in <module>
      1 import eikon as ek
      2 import numpy as np
----> 3 ek.set_app_key('### EIKON APP KEY ###')
      4 df = ek.get_timeseries(["MSFT.O"], start_date="2016-01-01",  end_date="2016-01-10")
      5 print(df)

~\anaconda3\lib\site-packages\eikon\Profile.py in set_app_key(app_key)
     31     You can get an app key using the App Key Generator (this App is available in Eikon Desktop).
     32     """
---> 33     get_profile().set_app_key(app_key)
     34      35 
~\anaconda3\lib\site-packages\eikon\Profile.py in set_app_key(self, app_key)
    221                 self._desktop_session._app_key = app_key  # = DesktopSession(app_key, self._on_state, self._on_event)
    222             else:
--> 223                 self._desktop_session = DesktopSession(app_key=app_key,
    224                                                        on_state= self._on_state,
    225                                                        on_event=self._on_event) 
.............
-.............
...........

AttributeError: module 'anyio' has no attribute 'Lock'


I highlight that with PYCharm e with Python IDE it's all ok.

Thank you for suggests.

Denis

icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hello @Denis Dal Soler

Looks like in the local Anaconda python, anyio module version does not match the interface expectation by eikon library 1.1.4.

What version do you have in Anaconda python environment? Looks like in PyCharm python the interface matches, so using the same version as in PyCharm should work.

Alternatively, reviewing this previous discussion thread it should also work to downgrade anyio to version 3.2.1. My own version of anyio is even older, and I do not reproduce the interface issue on my side.

icon clock
10 |1500

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

Upvotes
21 0 0 1

If you have issue only in Jupyter Lab, that means you are using another pyhton env than in PyCharm.

From Jupyter Lab, you can check all installed versions with "!pip list" commande in a cell:

1638401814870.pngTo check a specific package, here eikon
=> to check eikon version => "!pip list | findstr eikon"

You can also install or upgrade/downgrade a package.
Example: upgrade eikon to 1.1.14 => "!pip install eikon==1.1.14"


1638401814870.png (12.4 KiB)
icon clock
10 |1500

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

Upvotes
1 0 0 1

Dear @pf and @zoya faberov

thankyou for your answers.

I checked the eikon version on jupyter and it's the same of PC (1.1.14).

I can get over it!

I'll use PC...

Thankyou very much for your time.

icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hello @Denis Dal Soler ,

I totally agree with @pf on the best way to self-help, in your jupyter, notebook, you can run:

pip list

observe the modules and versions installed.

Assuming that PyCharm uses python that it find in your system path, on command line (DOS shell) you can run:

python -m pip list

and observe the modules and versions installed

This should allow to identify the differences in versions. You can then proceed as suggested by @pf to adjust the versions by upgrading to specific ones on jup version.

Hope this information helps.

icon clock
10 |1500

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

Upvotes
1 0 0 1

Dear @zoya faberov I made your test.

The results:

- Eikon is the same version in PC and JN

- I found a difference version in

**Python used by PC is Python 3.8.8 rc1, Python use in JN is 3.8.8

-- Python-dateutil in PC is 2.8.2 and in JN is 2.8.1

Could be these differences the problems? And if yes how can upgrade the Python version to 3.8.8 rc1 in Anaconda?


Thanks again

Denis


icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hello @Denis Dal Soler ,

I believe this build version discrepancy in python can be the cause of the issue you observe. If python has become corrupted- possibly.

Anaconda supports installing multiple versions of python at the same time, please see Managing Python but I would not recommend pursuing this.

With the type of issue that you see, some developers were helped by downgrading their httpx. Please see this previous discussion thread.

pip install httpx==0.19.0

But you have run pip list from Jup and from system python, have compared the two results, and did not observe any other differences on the working python? If your httpx on Jup environment is 20, I would still downgrade to 19, to verify, however if you did not see it to be different with the working python environment, I think that this is unlikely to be the cause.

icon clock
10 |1500

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

Upvotes
1 0 0 1

Dear @zoya faberov I tried to downgrade httpx to 0.19.0 but nothing ... it doesn't go!

This the error

EikonError: Error code 401 | Eikon Proxy not running or cannot be reached. Please read the documentation on troubleshooting


With PC all ok!




icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hello @Denis Dal Soler ,

Thanks, and sorry to hear this did not fix the issue.

When you have a chance, could you please share, from Jupyter notebook, the complete output from command:

pip list

And also try next:

import eikon as ek
ek.set_log_level(1)
ek.set_app_key('YOURKEYHERE_DONOTSHARE')
ek.get_news_headlines('R:LHAG.DE', date_from='2021-04-01T09:00:00', date_to='2021-4-05T18:00:00')

I understand this will not work, please share the output, so we can try to narrow down on the possible cause.

icon clock
10 |1500

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

Upvotes
1 0 0 1

Dear @zoya faberov here what you asked me

Pip list

labaster                          0.7.12
anaconda-client                    1.7.2
anaconda-navigator                 2.1.1
anaconda-project                   0.9.1
anyio                              3.3.4
appdirs                            1.4.3
argh                               0.26.2
argon2-cffi                        20.1.0
asn1crypto                         1.4.0
astroid                            2.5
astropy                            4.2.1
async-generator                    1.10
atomicwrites                       1.4.0
attrs                              20.3.0
autopep8                           1.5.6
Babel                              2.9.0
backcall                           0.2.0
backports.functools-lru-cache      1.6.4
backports.shutil-get-terminal-size 1.0.0
backports.tempfile                 1.0
backports.weakref                  1.0.post1
bcrypt                             3.2.0
beautifulsoup4                     4.9.3
bitarray                           1.9.2
bkcharts                           0.2
black                              19.10b0
bleach                             3.3.0
bokeh                              2.3.2
boto                               2.49.0
Bottleneck                         1.3.2
brotlipy                           0.7.0
certifi                            2021.10.8
cffi                               1.14.5
chardet                            3.0.4
charset-normalizer                 2.0.7
click                              7.1.2
cloudpickle                        1.6.0
clyent                             1.2.2
colorama                           0.4.4
comtypes                           1.1.9
conda                              4.10.3
conda-build                        3.21.4
conda-content-trust                0+unknown
conda-package-handling             1.7.3
conda-repo-cli                     1.0.4
conda-token                        0.3.0
conda-verify                       3.4.2
contextlib2                        0.6.0.post1
cryptography                       3.4.7
cycler                             0.10.0
Cython                             0.29.23
cytoolz                            0.11.0
dask                               2021.4.0
DateTime                           4.3
decorator                          5.0.6
defusedxml                         0.7.1
deprecation                        2.1.0
diff-match-patch                   20200713
distributed                        2021.4.0
docutils                           0.17
eikon                              1.1.14
entrypoints                        0.3
et-xmlfile                         1.0.1
fastcache                          1.1.0
filelock                           3.0.12
flake8                             3.9.0
Flask                              1.1.2
fsspec                             0.9.0
future                             0.18.2
gevent                             21.1.2
glob2                              0.7
gmpy2                              2.0.8
greenlet                           1.0.0
h11                                0.12.0
h2                                 3.2.0
h5py                               2.10.0
HeapDict                           1.0.1
hpack                              3.0.0
html5lib                           1.1
http3                              0.6.7
httpcore                           0.13.7
httpx                              0.19.0
hyperframe                         5.2.0
idna                               2.8
imagecodecs                        2021.3.31
imageio                            2.9.0
imagesize                          1.2.0
importlib-metadata                 3.10.0
inflection                         0.5.1
iniconfig                          1.1.1
intervaltree                       3.1.0
ipykernel                          5.3.4
ipython                            7.22.0
ipython-genutils                   0.2.0
ipywidgets                         7.6.3
isort                              5.8.0
itsdangerous                       1.1.0
jdcal                              1.4.1
jedi                               0.17.2
Jinja2                             2.11.3
joblib                             1.0.1
json5                              0.9.5
jsonschema                         3.2.0
jupyter                            1.0.0
jupyter-client                     6.1.12
jupyter-console                    6.4.0
jupyter-core                       4.7.1
jupyter-packaging                  0.7.12
jupyter-server                     1.4.1
jupyterlab                         3.0.14
jupyterlab-pygments                0.1.2
jupyterlab-server                  2.4.0
jupyterlab-widgets                 1.0.0
keyring                            22.3.0
kiwisolver                         1.3.1
lazy-object-proxy                  1.6.0
libarchive-c                       2.9
llvmlite                           0.36.0
locket                             0.2.1
lxml                               4.6.3
MarkupSafe                         1.1.1
matplotlib                         3.3.4
mccabe                             0.6.1
menuinst                           1.4.16
mistune                            0.8.4
mkl-fft                            1.3.0
mkl-random                         1.2.1
mkl-service                        2.3.0
mock                               4.0.3
more-itertools                     8.7.0
mpmath                             1.2.1
msgpack                            1.0.2
multipledispatch                   0.6.0
multitasking                       0.0.9
mypy-extensions                    0.4.3
navigator-updater                  0.2.1
nbclassic                          0.2.6
nbclient                           0.5.3
nbconvert                          6.0.7
nbformat                           5.1.3
nest-asyncio                       1.5.1
networkx                           2.5
nltk                               3.6.1
nose                               1.3.7
notebook                           6.3.0
numba                              0.53.1
numexpr                            2.7.3
numpy                              1.20.1
numpydoc                           1.1.0
olefile                            0.46
openpyxl                           3.0.7
packaging                          20.9
pandas                             1.2.4
pandocfilters                      1.4.3
paramiko                           2.7.2
parso                              0.7.0
partd                              1.2.0
path                               15.1.2
pathlib2                           2.3.5
pathspec                           0.7.0
pathtools                          0.1.2
patsy                              0.5.1
pep8                               1.7.1
pexpect                            4.8.0
pickleshare                        0.7.5
Pillow                             8.2.0
pip                                21.0.1
pkginfo                            1.7.0
pluggy                             0.13.1
ply                                3.11
prometheus-client                  0.10.1
prompt-toolkit                     3.0.17
psutil                             5.8.0
ptyprocess                         0.7.0
py                                 1.10.0
pycodestyle                        2.6.0
pycosat                            0.6.3
pycparser                          2.20
pycurl                             7.43.0.6
pydocstyle                         6.0.0
pyerfa                             1.7.3
pyflakes                           2.2.0
Pygments                           2.8.1
PyJWT                              2.1.0
pylint                             2.7.4
pyls-black                         0.4.6
pyls-spyder                        0.3.2
PyNaCl                             1.4.0
pyodbc                             4.0.0-unsupported
pyOpenSSL                          20.0.1
pyparsing                          2.4.7
pyreadline                         2.1
pyrsistent                         0.17.3
PySocks                            1.7.1
pytest                             6.2.3
python-dateutil                    2.8.1
python-jsonrpc-server              0.4.0
python-language-server             0.36.2
pytz                               2021.1
PyWavelets                         1.1.1
pywin32                            227
pywin32-ctypes                     0.2.0
pywinpty                           0.5.7
PyYAML                             5.4.1
pyzmq                              20.0.0
QDarkStyle                         2.8.1
QtAwesome                          1.0.2
qtconsole                          5.0.3
QtPy                               1.9.0
Quandl                             3.6.1
regex                              2021.4.4
requests                           2.22.0
requests-async                     0.6.2
rfc3986                            1.5.0
rope                               0.18.0
Rtree                              0.9.7
ruamel-yaml-conda                  0.15.100
scikit-image                       0.18.1
scikit-learn                       0.24.1
scipy                              1.6.2
seaborn                            0.11.1
Send2Trash                         1.5.0
setuptools                         52.0.0.post20210125
simplegeneric                      0.8.1
singledispatch                     0.0.0
sip                                4.19.13
six                                1.15.0
sniffio                            1.2.0
snowballstemmer                    2.1.0
sortedcollections                  2.1.0
sortedcontainers                   2.3.0
soupsieve                          2.2.1
Sphinx                             4.0.1
sphinxcontrib-applehelp            1.0.2
sphinxcontrib-devhelp              1.0.2
sphinxcontrib-htmlhelp             1.0.3
sphinxcontrib-jsmath               1.0.1
sphinxcontrib-qthelp               1.0.3
sphinxcontrib-serializinghtml      1.1.4
sphinxcontrib-websupport           1.2.4
spyder                             4.2.5
spyder-kernels                     1.10.2
SQLAlchemy                         1.4.7
statsmodels                        0.12.2
sympy                              1.8
tables                             3.6.1
tblib                              1.7.0
terminado                          0.9.4
testpath                           0.4.4
textdistance                       4.2.1
threadpoolctl                      2.1.0
three-merge                        0.1.1
tifffile                           2021.4.8
toml                               0.10.2
toolz                              0.11.1
tornado                            6.1
tqdm                               4.59.0
traitlets                          5.0.5
typed-ast                          1.4.2
typing-extensions                  3.7.4.3
ujson                              4.0.2
unicodecsv                         0.14.1
urllib3                            1.25.11
watchdog                           1.0.2
wcwidth                            0.2.5
webencodings                       0.5.1
websocket-client                   1.2.1
Werkzeug                           1.0.1
wheel                              0.36.2
widgetsnbextension                 3.5.1
win-inet-pton                      1.1.0
win-unicode-console                0.5
wincertstore                       0.2
wrapt                              1.12.1
xlrd                               2.0.1
XlsxWriter                         1.3.8
xlwings                            0.23.0
xlwt                               1.3.0
xmltodict                          0.12.0
yapf                               0.31.0
yfinance                           0.1.64
zict                               2.0.0
zipp                               3.4.1
zope.event                         4.5.0
zope.interface                     5.3.0



Code return

2021-12-08 18:56:13,426 P[12928] [MainThread 4600] Reset a Desktop session with new app_key 2021-12-08 18:56:13,429 P[12928] [MainThread 4600] Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy... 2021-12-08 18:56:13,431 P[12928] [MainThread 4600] Request to http://127.0.0.1:9060/api/status
    headers = {'x-tr-applicationid': 'xxxxxxxxxxxxxxxxxxxxx'}     params = None 2021-12-08 18:56:13,433 P[12928] [MainThread 4600] HTTP request failed: TypeError("float() argument must be a string or a number, not 'coroutine'") 2021-12-08 18:56:13,435 P[12928] [MainThread 4600] Error on checking proxy url http://127.0.0.1:9060/api/status : TypeError("float() argument must be a string or a number, not 'coroutine'") 2021-12-08 18:56:13,436 P[12928] [MainThread 4600] Warning: file .portInUse was not found. Try to fallback to default port number. 2021-12-08 18:56:13,438 P[12928] [MainThread 4600] Try defaulting to port 9000... 2021-12-08 18:56:13,439 P[12928] [MainThread 4600] Send GET request to http://127.0.0.1:9000/api/status to detect API Proxy... 2021-12-08 18:56:13,441 P[12928] [MainThread 4600] Request to http://127.0.0.1:9000/api/status
    headers = {'x-tr-applicationid': 'xxxxxxxxxx'}     params = None 2021-12-08 18:56:13,443 P[12928] [MainThread 4600] HTTP request failed: TypeError("float() argument must be a string or a number, not 'coroutine'") 2021-12-08 18:56:13,445 P[12928] [MainThread 4600] Error on checking proxy url http://127.0.0.1:9000/api/status : TypeError("float() argument must be a string or a number, not 'coroutine'") 2021-12-08 18:56:13,448 P[12928] [MainThread 4600] Try defaulting to port 36036... 2021-12-08 18:56:13,449 P[12928] [MainThread 4600] Send GET request to http://127.0.0.1:36036/api/status to detect API Proxy... 2021-12-08 18:56:13,451 P[12928] [MainThread 4600] Request to http://127.0.0.1:36036/api/status
    headers = {'x-tr-applicationid': 'xxxxxxxxxxxx'}     params = None 2021-12-08 18:56:13,453 P[12928] [MainThread 4600] HTTP request failed: TypeError("float() argument must be a string or a number, not 'coroutine'") 2021-12-08 18:56:13,454 P[12928] [MainThread 4600] Error on checking proxy url http://127.0.0.1:36036/api/status : TypeError("float() argument must be a string or a number, not 'coroutine'") 2021-12-08 18:56:13,456 P[12928] [MainThread 4600] Error: no proxy address identified. Check if Eikon Desktop or Eikon API Proxy is running. 2021-12-08 18:56:13,457 P[12928] [MainThread 4600] Try to handshake on url http://127.0.0.1:None/api/handshake...
2021-12-08 18:56:13,458 P[12928] [MainThread 4600] Request to http://127.0.0.1:None/api/handshake
    headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'dxxxxxxxxxxx'}     params = None 2021-12-08 18:56:13,460 P[12928] [MainThread 4600] HTTP request failed: UnsupportedProtocol("Request URL missing either an 'http://' or 'https://' protocol.") 2021-12-08 18:56:13,461 P[12928] [MainThread 4600] Error on handshake url http://127.0.0.1:None/api/handshake : UnsupportedProtocol("Request URL missing either an 'http://' or 'https://' protocol.") 2021-12-08 18:56:13,464 P[12928] [MainThread 4600] Error on handshake url http://127.0.0.1:None/api/handshake : UnsupportedProtocol("Request URL missing either an 'http://' or 'https://' protocol.") 2021-12-08 18:56:13,466 P[12928] [MainThread 4600] Port number was not identified, cannot send any request 2021-12-08 18:56:13,467 P[12928] [MainThread 4600] Received notification for closed streaming session 0 2021-12-08 18:56:13,468 P[12928] [MainThread 4600] Received notification for closed streaming session 0 2021-12-08 18:56:13,469 P[12928] [MainThread 4600] Init a Desktop session with new app_key 2021-12-08 18:56:13,471 P[12928] [MainThread 4600] entity: News_Headlines 2021-12-08 18:56:13,473 P[12928] [MainThread 4600] payload: {'number': '10', 'query': 'R:LHAG.DE', 'productName': 'xxxxxxxxx', 'attributionCode': '', 'dateFrom': '2021-04-01T09:00:00', 'dateTo': '2021-04-05T18:00:00'} 2021-12-08 18:56:13,474 P[12928] [MainThread 4600] Request:{'Entity': {'E': 'News_Headlines', 'W': {'number': '10', 'query': 'R:LHAG.DE', 'productName': 'xxxxxxxxxx', 'attributionCode': '', 'dateFrom': '2021-04-01T09:00:00', 'dateTo': '2021-04-05T18:00:00'}}} 2021-12-08 18:56:13,476 P[12928] [MainThread 4600] Request to http://127.0.0.1:None/api/v1/data
    headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'xxxxxxxxxx'}     params = None 2021-12-08 18:56:13,478 P[12928] [MainThread 4600] HTTP request failed: UnsupportedProtocol("Request URL missing either an 'http://' or 'https://' protocol.") 2021-12-08 18:56:13,480 P[12928] [MainThread 4600] HTTP Error: Request URL missing either an 'http://' or 'https://' protocol. 2021-12-08 18:56:13,482 P[12928] [MainThread 4600] Eikon Proxy not running or cannot be reached. Please read the documentation on troubleshooting

---------------------------------------------------------------------------
EikonError                                Traceback (most recent call last)
<ipython-input-12-ea24bb8ef6f3> in <module>
      2 ek.set_log_level(1)
      3 ek.set_app_key('xxxxxxxxxxxx')
----> 4 ek.get_news_headlines('R:LHAG.DE', date_from='2021-04-01T09:00:00', date_to='2021-4-05T18:00:00')

~\anaconda3\lib\site-packages\eikon\news_request.py in get_news_headlines(query, count, date_from, date_to, raw_output, debug)
    119         payload.update({
                'dateTo': to_datetime(date_to).isoformat()})
    120 --> 121     result = eikon.json_requests.send_json_request(News_Headlines_UDF_endpoint, payload, debug=debug)
    122     123     if raw_output:

~\anaconda3\lib\site-packages\eikon\json_requests.py in send_json_request(entity, payload, debug)
    147             error_msg = 'Eikon Proxy not running or cannot be reached. Please read the documentation on troubleshooting'
    148             logger.error(error_msg)
--> 149             raise EikonError(401, error_msg)
    150     151 
EikonError: Error code 401 | Eikon Proxy not running or cannot be reached. Please read the documentation on troubleshooting


Thanks

icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hello @Denis Dal Soler ,

Was not able to identify the issue, the env looks good to me, and for the purposes of testing, I have updated, in my testbed python jupyter environment, the libraries that are relevant to eikon usage to the exact same versions as you run : eikon, anyio, httpcore, httpx, urllib3, nest_asynchio, but still did not reproduce the issue- mine still connects to eikon proxy, successfully.

---

As a sanity check, when you type, into the same browser you are running jupyter from:

http://127.0.0.1:9060/api/status 

You see "ready"? I.e. your proxy is running on port 9060 at the time the request is being made?

---

Because you have a unique situation, you are able to run without issues from PyCharm, you can obtain very useful info by running a test that would allow to be sure if the issue is within python environment in use by Jupyter. You can add the python environment in use by Jupyter as another python interpreter into PyCharm and run your project within Pyhcarm with "jup" python:

pythoninterpreters.gif

then just switch back to the interpreter/python that you normally use from PyCharm and compare the results.


icon clock
10 |1500

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

Upvotes
1 0 0 1

Dear @zoya faberov

when I type

  1. http://127.0.0.1:9060/api/status

I see this

{"statusCode":"ST_PROXY_READY","version":"2.9.0"}

But when i change interpreter in PC (from anaconda folder)... I received the same error like Jupyter!!!

documento5-word-2021-12-10-140647.png

Can I change Python interpreter for jupyter??

Many many thanks ...


icon clock
10 |1500

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

Upvotes
23k 22 9 14

Hello @Denis Dal Soler ,

To my knowledge, Anaconda does not offer an easy, GUI-based way to swap just an external python into an anaconda environment. It works exclusively with it's own, packaged environments.

You can easily create another environment (or a couple) from Anaconda via Environments->Create. And set it up afresh with what you need. See Using multiple versions of Python with Navigator. You will need to install the libraries on the new env, but the added advantage is, if an installed library became corrupted in the local environment, you are getting a new one, so instead of finding which one, you will be side-stepping the issue.

Or can import an existent into Anaconda via GUI, but only if you have a yaml to import. Can not import an existent plain python environment this way.

To make an existent python into an anaconda-recognized python, you would have to go outside of Anaconda GUI, run command line and edit yml, which I find not quick and not totally robust, a small typo somewhere and it may become corrupted and hang, without reporting what or where is off. However, would like to include Sharing Environments link in case you would like to proceed this way.

icon clock
10 |1500

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

Upvotes
1 0 0 1

Dear @zoya faberov now it's all ok!!!!!

I've created a couple of Python enviroment and now is perfect!!

I'm very grateful to you, to your patience and your professionalism.

Many many thanks

Best regards

Denis


icon clock
10 |1500

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

Click below to post an Idea Post Idea