question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FileNotFoundError: Could not find module 'libopenvr_api_64' on Windows with Anaconda

See original GitHub issue

Hi, I’m trying to setup a conda environment to code in Spyder. However, when I try to import openvr, I get a FileNotFoundError on the dll. I found that adding CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1 is not enough (related issue). I get a WinError deeper in the callstack.

To recreate

conda create -n openvr-env python -y conda activate openvr-env pip install openvr python import openvr

Traceback

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\<User>\miniconda3\envs\openvr-env\lib\site-packages\openvr\__init__.py", line 64, in <module>
    _openvr = cdll.LoadLibrary(_openvr_lib_name)
  File "C:\Users\<User>\miniconda3\envs\openvr-env\lib\ctypes\__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\<User>\miniconda3\envs\openvr-env\lib\ctypes\__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libopenvr_api_64' (or one of its dependencies). Try using the full path with constructor syntax.

OS: Windows 64bit

Possible fix

Always import the full path has it is done for Linux (line 62 in openvr_init_.py). This works fine in conda and in standard python install.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Florian-Cormeecommented, Sep 10, 2021

You are totally right. pkg_resources is a serious improvement.

I agree with you, python 3.7 as a requirement seems reasonnable.

I miss use the term “cross platform”. I meant it would add a dependency. Cross install would make more sense. It doesn’t really matter anyway.

I tested both pkg_resources and you’re latest switch to importlib both work like a charm on windows in my conda environment.

0reactions
cmbrunscommented, Sep 10, 2021

@Florian-Cormee that’s great news! Thanks for testing and reporting. By the way, I will probably go back to pkg_resources, because I found a problem with importlib on python 3.8, and python 3.8 will likely be the system python on Ubuntu LTS at least until April 2022. Eventually when python 3.8 is no longer important, it will be time to move to importlib.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FileNotFoundError: Could not find module when using jupyter ...
Same problem occured when trying to import sklearn. The version of my scipy is 1.6.3 and i solved the problem by degrading scipy...
Read more >
Troubleshooting — Anaconda documentation
I'm having trouble with the Anaconda installer on Windows. How can I debug my issue? Cannot get conda to run after installing; Recovering...
Read more >
How to Setup Your Python Environment for Machine Learning ...
In this tutorial, you will discover how to set up a Python machine learning development environment using Anaconda.
Read more >
Troubleshooting — conda 22.11.1.post16+ce4e810c9 ...
Unicode error after installing Python 2. Windows environment has not been activated. The system cannot find the path specified on Windows ...
Read more >
Fix Anaconda + Jupyter Notebook "module not found" errors ...
Did you install Anaconda but Jupyter Notebook can't find Anaconda ? Or you run Jupyter but nothing seems to be installed?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found