ModuleNotFoundError: No module named 'eikon'

I'm currently following the quick guides for setting up the API, and I have ran into a small issue that I can't figure out. I would be very grateful if I can get some help resolving this.
This is the code I'm running, which is just from the guide:
Here's the full terminal output:
(base) PS C:\Users\user\Miniconda3\envs\refinitiv> & 'C:\Users\user\Miniconda3\envs\refinitiv\python.exe' 'c:\Users\user\.vscode\extensions\ms-python.python-2022.4.1\pythonFiles\lib\python\debugpy\launcher' '57854' '--' 'c:\Users\user\Miniconda3\envs\refinitiv\APItest2.py'
Traceback (most recent call last):
File "C:\Users\user\Miniconda3\envs\refinitiv\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\user\Miniconda3\envs\refinitiv\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "c:\Users\user\.vscode\extensions\ms-python.python-2022.4.1\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
cli.main()
File "c:\Users\user\.vscode\extensions\ms-python.python-2022.4.1\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
run()
\server\cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
File "C:\Users\user\Miniconda3\envs\refinitiv\lib\runpy.py", line 269, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\user\Miniconda3\envs\refinitiv\lib\runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\user\Miniconda3\envs\refinitiv\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "c:\Users\user\Miniconda3\envs\refinitiv\APItest2.py", line 1, in <module>
import eikon as ek
ModuleNotFoundError: No module named 'eikon'
Here's the result of 'pip list' in the same directory:
Package Version
---------------------- ---------
anyio 3.5.0
appdirs 1.4.4
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
asttokens 2.0.5
attrs 21.4.0
backcall 0.2.0
beautifulsoup4 4.10.0
bleach 4.1.0
Bottleneck 1.3.4
brotlipy 0.7.0
certifi 2021.10.8
cffi 1.15.0
chardet 3.0.4
charset-normalizer 2.0.4
colorama 0.4.4
conda 4.12.0
conda-package-handling 1.8.1
cryptography 36.0.0
cycler 0.11.0
DateTime 4.4
debugpy 1.5.1
decorator 5.1.1
defusedxml 0.7.1
deprecation 2.1.0
eikon 1.1.14
entrypoints 0.4
executing 0.8.3
fastjsonschema 2.15.1
fonttools 4.25.0
h11 0.12.0
h2 3.2.0
hpack 3.0.0
httpcore 0.14.7
httpx 0.22.0
hyperframe 5.2.0
idna 2.10
ipykernel 6.9.1
ipython 8.2.0
ipython-genutils 0.2.0
ipywidgets 7.6.5
jedi 0.18.1
Jinja2 3.0.3
jsonschema 4.4.0
jupyter 1.0.0
jupyter-client 7.1.2
jupyter-console 6.4.3
jupyter-core 4.9.2
jupyterlab-pygments 0.1.2
jupyterlab-widgets 1.0.0
kiwisolver 1.3.2
MarkupSafe 2.0.1
matplotlib 3.5.1
matplotlib-inline 0.1.2
menuinst 1.4.18
mistune 0.8.4
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
munkres 1.1.4
nbclient 0.5.11
nbconvert 6.4.4
nbformat 5.3.0
nest-asyncio 1.5.5
notebook 6.4.8
numexpr 2.8.1
numpy 1.21.5
packaging 21.3
pandas 1.4.1
pandocfilters 1.5.0
parso 0.8.3
pickleshare 0.7.5
Pillow 9.0.1
pip 21.2.4
prometheus-client 0.13.1
prompt-toolkit 3.0.20
pure-eval 0.2.2
pycosat 0.6.3
pycparser 2.21
Pygments 2.11.2
pyOpenSSL 22.0.0
pyparsing 3.0.4
pyrsistent 0.18.0
PySocks 1.7.1
python-dateutil 2.8.2
pytz 2021.3
pywin32 302
pywinpty 2.0.2
pyzmq 22.3.0
qtconsole 5.3.0
QtPy 2.0.1
requests 2.27.1
rfc3986 1.5.0
ruamel-yaml-conda 0.15.100
Send2Trash 1.8.0
setuptools 61.2.0
sip 4.19.13
six 1.16.0
sniffio 1.2.0
soupsieve 2.3.1
stack-data 0.2.0
terminado 0.13.1
testpath 0.5.0
tornado 6.1
tqdm 4.63.0
traitlets 5.1.1
typing_extensions 4.1.1
urllib3 1.26.8
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 1.3.2
wheel 0.37.1
widgetsnbextension 3.5.2
win-inet-pton 1.1.0
wincertstore 0.2
zope.interface 5.4.0
Best Answer
-
Hello @nathen.gildow
I noticed that your active Conda is the base environment but your code is in the refinitiv environment.
Which Conda environment you have installed the Eikon Data API? If you have installed Eikon Data API library in the refinitiv environment, please change the active Conda environment to be refinitiv and re-test.
(base) $> conda activate refinitiv
(refinitive) $> python APITest2.pyYou can press the F1 button and select the "Python: Select Interpreter" option to choose the Conda's refinitiv environment in VS Code.
0
Answers
-
Hi @nathen.gildow, May I ask if you've tried (i) uninstalling and re-installing the eikon data API? (ii) trying out the refinitiv data platform python library which allows for the same get_data function or (iii) using another version of eikon data api (==1.1.13)?
0 -
Hi @nathen.gildow ,
To be sure you're using same Python environment with your script and your terminal, you should check python version :
1. in your script with
import sys
print(sys.version)2. in your shell with
>python -c "import sys; print(sys.version)"
Then compare results.
0 -
Thanks for the response Jonathan!
(i) uninstalling and re-installing the eikon data API?
- Tried this with no success already.
(ii) trying out the refinitiv data platform python library which allows for the same get_data function.
- I’m not exactly sure what this means or how to do it. This is the first time I’ve set up an API, so I may need detailed instructions.(iii) using another version of eikon data api (==1.1.13).
- I’m unsure of how to do this as well.0 -
Thanks for the response pf, both the script and terminal python versions show 3.10.4
0 -
You can run help('modules') before importing eikon to list all available modules in the current environment.
help('modules')
import eikon as ekThen, check if there is an eikon module installed.
0 -
0
-
Never mind, I was able to just run pip install again within the terminal in VScode. but now have received another error:
EikonError: Error code 401 | Eikon Proxy not running or cannot be reached. Please read the documentation on troubleshooting.
I've walked a bit through the troubleshooting document and have found that i cannot currently connect to http://localhost:9000/ping?all0 -
This has been solved, thank you everyone!
I was unaware that you need to install eikon within the VScode python terminal as well.
0 -
Hello @nathen.gildow
Did you run the Eikon/Workspace desktop application? Please note that the Refinitiv Workspace/Eikon application integrates a Data API proxy that acts as an interface between the Eikon Data API Python library and the Eikon Data Platform. For this reason, the Refinitiv Workspace/Eikon application must be running when you use the Eikon Data API Python library.
0 -
Hello @nathen.gildow
I think you can just switch the Python Env in VS Code from Base to the one that you have installed Eikon Data API.
You can find more detail in the following resources:
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 630 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 86 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛