OSError when tried to load librosa (import soundfile error) - anaconda

When I ran import librosa, I got the following error message:
OSError: cannot load library 'C:\ProgramData\Anaconda3\Library\bin\sndfile.dll': error 0x7e
and
OSError: cannot load library 'C:\ProgramData\Anaconda3\lib\site-packages\_soundfile_data\libsndfile64bit.dll': error 0x7e.
I installed librosa package with conda install -c conda-forge librosa, pysound with conda install -c conda-forge pysoundfile, and soundfile with pip install SoundFile.
But this didn't solve the problem.
Does anyone got a similar error or know how to fix this?
Update: I created a new environment on anaconda and installed librosa. This fixed the loading issue, but I'm wondering if there's a way to fix this issue in my base environment.

It may seem as a brute force approach but uninstalling and then installing the same module worked for me

Related

import torch OSError: [WinError 127]

I'm trying to install torch-gpu. I have installed cuda 11.1 and installed torch via the command pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
It is so stupid but during the importing I have the following error OSError: [WinError 127] Error loading "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\torch\lib\c10_cuda.dll" or one of its dependencies..
c10_cuda.dll exists in that directory, I spent several days and still can't solve it. I need torch-gpu and that's the point of using that possibility, please, do not comment 'install torch-cpu'.
Answering the question myself
To install torch-gpu one should:
check the latest (or not) versions and compatible cuda version: https://pytorch.org/get-started/locally/, at this moment it is 11.1.
download and install cuda of the established version in 1) step (https://developer.nvidia.com/cuda-toolkit-archive). That depends on the gpu, if any problems you may download older versions or maybe you have it installed? then you can check version manually in the command line: nvcc --version.
install torch using commands as found in the 1) step (for instance conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge)
check the installation success as import torch torch.cuda.is_available().
In my case I had to delete previously installed torch pip uninstall torch and use conda clean -a for installation to end successfully.

Installing PyArrow for the purpose of pandas-gbq

I have tirelessly tried to get pandas-gbq to download via the pip installer (pip 20.3.3; python 3.9.1). Whenever I pip install pandas-gbq, it errors out when it attempts to import/install pyarrow.
I further tested this theory that it was having trouble with PyArrow by testing "pip install pyarrow" itself. This had the same error. I can post parts of the error if requested, but it's thousands of lines long and I can't even identify what the error is. I have 64 bit python, 64 bit pycharm, 64 bit machine etc etc.
Has anyone had trouble with this before. My solution was downloading Anaconda and I was able to conda install pyarrow, but I really don't understand what the problem with it all is. To further complicate the issue, I am able to leverage pandas-gbq by running my python project located in a venv created by PyCharm in cmd.exe, however I cannot run it in the PyCharm console.
When I have tried reconfiguring my python interpreter in PyCharm, it just says it cannot find the path to the project. Lotssss of confusion, would appreciate any help!
I encountered the same problem myself,
what worked for me is reinstalling it with pip and restarting the Jupyter notebook
you might also try reinstalling it with conda
conda install -c conda-forge pyarrow
as per this answer below, for a similar question, which seems to cover the case
Error importing pyarrow in jupyter notebook after pip installation of pyarrow

Error while installing JupyterLab with pip Windows

I face the below error while trying to install package dependencies for JupyterLab via pip.
Installing collected packages: jedi, ipython, ipykernel, notebook, jupyterlab-server, jupyterlab
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\<Username>\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\jedi\\third_party\\typeshed\\third_party\\2and3\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\_implementation.pyi'
EDIT : All these packages have dependencies on Jedi, and I'm unable to install Jedi. Can someone help how I can remove this SSL hostname error?
The issue was with the pathname being too long. Uninstalled and reinstalled python, removed restriction on path variable length. And done, solved.
When you are installing Python is important to "Disable path length limit" , and that it's!

Importing tensorflow_datasets

I am trying to import tensorflow_datasets to load a data set, but I found that I should install tensorflow_datasets using either pip or conda. I installed it twice using both methods. But tensorflow_datasets do not still work in jupyter notebook. In the last attempt I got the following error:
ImportError: cannot import name 'kwarg_only' from 'tensorflow.python.util.tf_export'
Plus
Failed to import TensorFlow. Please note that TensorFlow is not installed by default when you install TensorFlow Datasets. This is so that users can decide whether to install the GPU-enabled TensorFlow package. To use TensorFlow Datasets, please install the most recent version of TensorFlow, by following instructions at https://tensorflow.org/install.
While I have TensorFlow installed. I searched the net but none of the solutions solved the problem. Any help is appreciated.
Try to create a separate environment and then install tensorflow and tensorflow_datasets using pip install tensorflow==2.0.0 and pip install tensorflow_datasets==2.1.0. Its works fine.

"ImportError: DLL load failed: The specified procedure could not be found." When importing pygpu

I installed theano, keras, pygpu, and libgpuarray via conda install, and I get this error. I'm attempting to run a convolutional network on my GPU. Does anybody know how to fix this problem?
OS: Windows 10
I had exactly the same problem. I had originally installed the latest pygpu 0.6.4. When I installed pygpu 0.6.2 then I still got a lot of error messages, but at least it used the GPU!
Run the following command to downgrade:
conda install theano pygpu=0.6.2
I hope that helps!
Robert

Resources