I am using python programming language and Installed librosa version 0.8 on windows 10 operating system and installed successfully but when import library it gives me error ----> "ModuleNotFoundError: No module named 'librosa'"
I tried solution from below articles but failed
https://nomodulenamed.com/m/librosa
https://pypi.org/project/librosa/
appreciate if someone faced same issue
After installing, in the command prompt, print the version of librosa, using pip show librosa
If the information is displayed, it means that you have successfully installed librosa. However, if the error still persists it's (most likely) because of 1 of 3 reasons:
Your files aren't in the same directory as your libraries, or
You need to restart your kernel to allow it to access the library.
Librosa only works with 3.7.9 and earlier, so you might be using an incompatible version of python.
Because you are using 3.9.1, it is probably caused because of the 3rd reason.
Related
I have installed the OpenSeesPyMac module from
https://pypi.org/project/openseespymac/. I am getting the following error on importing this module:
import openseespymac.opensees as ops
ImportError Traceback (most recent call last)
<ipython-input-9-bec14fefea3d> in <module>
----> 1 import openseespymac.opensees as ops
ImportError: dlopen(/usr/local/anaconda3/lib/python3.7/site-packages/openseespymac/opensees.so, 2): Library not loaded: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python
Referenced from: /usr/local/anaconda3/lib/python3.7/site-packages/openseespymac/opensees.so
Reason: image not found
I am using anaconda distribution of python in /usr/local/anaconda3 but it seems like this module is trying to find python in /usr/local/opt/python... I will really appreciate if someone could guide on how to resolve this error.
That error occurs when the Python 3 library is missing from your system. On Mac OS, Python 3 has to be installed manually and there are several ways to do this properly:
The right and wrong way to set Python 3 as default on a Mac
I recommend “Homebrew" personally.
Note that this error can also occur if Python 3 is installed in a non-standard file path on the system directory, and OpenSeesPy cannot find it. This is the case when Python 3 is installed through Anaconda. OpenSeesPy looks for Python in the directories where system libraries are usually found, i.e., /usr/local/. If Python 3 is installed from Homebrew, or through the installer from the Python website, it should find the library. If not, then you will run into the error that you mention.
When I ran the example code using scikit-surprise which is a package in python, it showed that "cannot import name similarities".
My operating system is windows 10 and python version is 2.7. When I tried to ran the exactly the same code on the school computer, it succeeded. The operating system in school computer is also windows 10. So it's not the problem of operating system.
I am very confused about what happened. When I commented out the "from .. import similarities as sims", there is another import error "Import Error: No module named optimize_baselines".
When I checked what was .optimize_baselines and similarities, I found they were all .c files.
So it seems that it cannot correctly import .c files. But how to deal with that?
You see import error as those packages are not installed in your home computer. So if those are public packages then you can download it via pip or easy_install.
I solved this problem by installing python3. I installed python2 using anaconda and failed to run the system. I found that the same situation happened on my school computer that the system cannot run with python2 but succeed using python3. I am sorry that I just found I typed "scikit learn" . It should be "scikit surpirse" which is a recommendation system. I guessed the problem was because the C++ compiler. But I am not sure about that.
My current version of Python is the newest 3.5 and the only available PyGame was for 3.2 (both PyGame and Python are 32-bit). I've scoured stackoverflow for a resolution and can't find any way to make this work. I've installed the PyGame easy installer and placed it in the directory where my Python install is, and in Visual Studio (I've also tried this in PyCharm as well as the standard Python IDE in command prompt), upon typing
import pygame or import sys, pygame
I'm presented with the error Import Error was
unhandled by user code - DLL load failed: The specified module could not be found.
My final solution is to uninstall Python 3.5 and install the version which matches PyGame.
This shouldn't have anything to do with Python version. You are missing a dynamic library (the DLL). This means that either the DLL is not on your system or Python can't find it. You should probably try the msi/exe installer for PyGame mentioned here, as it should install any dependencies. This would fix the issue if it is caused by the DLL being absent from your system.
It could also be caused by the libraries not being on PYTHONPATH. Search the error you received and you should see quite a few answers on fixing this.
If you're just getting started, you may want to look at a different library. There are likely quite a few game libraries for Python that can be installed with a simple pip install. You could then return to PyGame when you are more comfortable if you wanted.
get it from here: https://www.dropbox.com/s/hnmcaq1rf6zn7m3/pygame-1.9.2a0-cp34-none-win32.whl?dl=0
download it and install it by putting it in C:\python3.5\Scripts
then run pip3 install pygame-1.9.2a0-cp34-none-win32.whl
(this is for 3.4, but 3.5 works too)
it should work, and your error has nothing to do with the package, it's just that you do not have a DLL file, install it again from the website above
I'm trying to use (and therefore install) an optimization package called mosek and more specifically to use it with python on a jupyter notebook.
It's a commercial package but since I'm working in academia, I have a free license.
This issue has been edited thanks to Paul insights.
My goal is to be able to use mosek in python 3.5 through jupyter.
1° My issue:
When I run the following line of code in jupyter notebook :
import mosek.fusion
I have the following error:
import mosek.fusion ---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-9-81543b63d59f> in <module>()
----> 1 import mosek.fusion
ImportError: No module named 'mosek.fusion'
2° What I did :
I first downloaded and installed mosek. I also added my licence in my folder mosek. (I did all the steps described here : http://docs.mosek.com/7.1/toolsinstall/Linux_UNIX_installation_instructions.html and added my academical license as well).
I then tried to run the line of code:
import mosek.fusion which gave an error.
I then tried to run:
import mosek
then I had no error. My conclusion is that mosek is (now, thanks to Paul), properly installed but that fusion module is missing.
I also search for any fusion file or folder in my mosek folder. I did not find any.
Is there a way to get this module fusion from mosek, and even better, is there a way to make it work?
Thank you all!
E.
I believe that it installed it to your .local because you installed with the --user flag. In other words:
python setup.py install --user
Trying running the install without the --user flag. That should install it in your conda environment.
But I'm not sure that is your import problem. Perhaps the fusion module doesn't exist. Try ls-ing what is in this folder /home/edwin/.local/lib/python3.5/site-packages/mosek/. Maybe try from mosek import fusion.
Fusion is not yet available for Python3. It will in the next major release, i.e. MOSEK 8.
The easiest way to install Mosek (for using from Python) is to use the pip installer:
pip install git+http://github.com/MOSEK/Mosek.pip#v7.0.0#egg=mosek
You may also want to set the environement variable for the Mosek lisence explicitly, e.g.
os.environ.setdefault("MOSEKLM_LICENSE_FILE", license) where license is a server address or a file location.
However, Mosek Fusion is not yet available for Python 3
Keep on the MOSEK website. Version 8(beta) soon to be released will support Python 3.5. Also full Anaconda support will soon be available.
Instead of using a Python distribution, I decided to install Scipy myself and stumbled upon Scipy Superpack (http://fonnesbeck.github.io/ScipySuperpack/). After installing Python 2.7.6 I followed the instructions on the website and everything seemed to work without any problems. However, once the installation was done I received a "fatal error" message as I tried to look through my modules. More specifically, the following error:
>>> help('modules')
Please wait a moment while I gather a list of all available modules...
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
I receive the same error message in the terminal, as well as through IDLE. Despite the error message, I am able to import and use numpy, as well as other modules from the superpack.
I should mention that prior to installing the superpack I installed pip. However, this didn't induce the previously mentioned error.
I am very new to osx, so any advice would be greatly appreciated!
I was also having a lot of problems while trying to install all the python libraries in my mac. I searched on the web for some hours and finally got something that worked out for me.
Scipy is here as well if you want to follow this rules instead:
https://gist.github.com/audy/4012573