I’m having some trouble accessing data from python, which I was able to do until recently. I have reinstalled python, and Refinitiv.data library, but still shows the same error –
ModuleNotFoundError: No module named 'refinitiv'
@AdarshJain
Thank you for reaching out to us.
The error indicates that the Python environment cannot locate the refinitiv module.
refinitiv
Possible causes include:
To troubleshoot the issue, verify that the library is installed in the active Python environment and confirm that your application is using the intended Python interpreter or virtual environment. You may need to run the following command to check the installed packages.
import importlib.metadata # Fetch all installed packages packages = importlib.metadata.distributions() # Loop and print package name and version for package in sorted(packages, key=lambda x: x.name.lower()): print(f"{package.name} == {package.version}")
You can also run this code to check for the site package paths.
import site import sys # 1. Print all active directories Python searches for packages print("--- All Search Paths (sys.path) ---") for path in sys.path: print(path) # 2. Print main global site-packages directories print("\n--- Global Site-Packages ---") try: for package_path in site.getsitepackages(): print(package_path) except AttributeError: # Handles alternative environments where getsitepackages() might be restricted print("Global paths restricted or unavailable in this environment.") # 3. Print user-level site-packages directory (used when running 'pip install --user') print("\n--- User-Level Site-Packages ---") print(site.getusersitepackages())
Moreover, the refintiv.data library is quite old. Please use the LSEG Data Library for Python instead.
pip install lseg-data
The examples are on GitHub.