I'm having trouble loading a package that is installed in my environment and have no idea why..
conda list
fbprophet 0.3.post2 py36_0 conda-forge
When I request for libraries installed in conda, it clearly shows that I have fbprophet installed. Now, when I import it, a ModuleNotFoundError exception is thrown.
from fbprophet import Prophet
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-83be6864a7aa> in <module>()
----> 1 from fbprophet import Prophet
2 import numpy as np
3 import pandas as pd
ModuleNotFoundError: No module named 'fbprophet'
Has anybody run into this issue? What can I do to troubleshoot this?
My suggestion would be creating a virtual environment for your python first, then conda install your package in the virtual environment.
My script was reading from my pip install list where the module fbprophet did not exist. I went back and installed it there and everything worked. Lesson learned.
Always check where your libraries are being read from.
You may have more than one Python installation. Thus you might installed the library in one Python installation and tried to call it from another one. Please let me know if you have more than one Python installation by printing the result os this CMD command where python.
Related
I am trying to import matplotlib library, which I have installed via cmd: pip install matplotlib. And it installed successfully. But when I try to import matplotlib in jupyter lab, it gives me an error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-15-9738723f2bbd> in <module>
----> 1 import matplotlib as plt
2 from matplotlib import pyplot as pllt
ModuleNotFoundError: No module named 'matplotlib'
I checked both my python files and the installed matplotlib are in the same directory. Any ideas whats's wrong?
Sometimes happens that pip is installing the module for older python versions. Try to reinstall using pip3
Edit: as pointed out by MattDMo, on Windows they are both installed in the same folder. However, leaving this answer as this might be an issue in Linux.
I'm using a Mac. I have Anaconda installed. When I type import numpy or import matplotlib I don't run into any issues. The only issue I'm having is with sklearn.
I'm fairly new to CS/ DS. Any help/ tips is greatly appreciated.
I've tried uninstalling sklearn and reinstalling. I've pretty much tried every solution on StackOverflow. The only thing I haven't tried is reinstalling anaconda.
import sklearn
Traceback (most recent call last):
File "", line 1, in
import sklearn
ModuleNotFoundError: No module named 'sklearn'
I expect to get no result just like with matplotlib and numpy which means everything works, but in lieu of that I get that output.
Do you have sklearn installed? It should be in some requirement, but it seems that someone needs it as a dependency and does not find it.
pip freeze | grep sklearn
It will tell you if you have it installed.
Do you work in a virtualenv?
If you do not have it installed try to do it and if not, pass the traceback.
if you work on mac you can also try updating xcode and updating yourself pip
xcode-select --install
pip install --upgrade pip
Importing scipy in iPython gave me:
In [1]: import scipy
-----------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-4dc45f4c0083> in <module>()
----> 1 import scipy
/usr/local/lib/python2.7/site-packages/scipy/__init__.py in <module>()
/usr/local/lib/python2.7/site-packages/scipy/_lib/_ccallback.py in <module>()
ImportError: cannot import name _ccallback_c
In [2]:
Did a complete update of all the files of Anaconda
> conda update --all
and the error remains. Did a complete search on the web and there are similar problems but without solutions. Can you help me?
i am giving you two solutions which might work by my expereince
1. create a virtualenv and install the scipy package in that virtualenv and give path like this
import sys
sys.path.append('/home/shashi/.virtualenvs/venv/lib/python2.7/site-packages/')
import scipy
2.
Download the source code https://github.com/scipy/scipy/archive/v0.18.0-1.zipand unpack it. Open a command window in the folder where the setup.py of the module is located and type
scipy python setup.py install
It looks like scipy is not installed
conda install -c anaconda scipy
Try this and let us know if you receive the error again
Cheers!
I am attempting to import a twitter api wrapper. I am using https://github.com/bear/python-twitter and have installed it using pip install python-twitter, when I run pip freeze into the command prompt it shows that I have python-twitter==3.2.1 installed however when I try to import it using import twitter in Jupyter QTConsole running Python 3.6.0, I get back this error:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-645f6dc1896f> in <module>()
----> 1 import twitter
ModuleNotFoundError: No module named 'twitter'
I am at a loss as to what is going wrong, the package doesn't say it's restricted to a certain version of python, and searching online hasn't helped. So now I am asking here in case anyone has a solution.
Turns out I had 2 versions of Anaconda installed and the package was defaulting to the wrong one, uninstalling the older version of anaconda and reinstalling the package fixed the problem.
I'm trying to install 'frida' on my Anaconda environment, and although it installs fine, I keep getting an error when importing it from IPython:
In [4]: import frida
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-58e5c65e5010> in <module>()
----> 1 import frida
ImportError: No module named frida
On the normal python shell the import works fine. The problem is only with IPython.
I've tried using easy_install from the conda command line - no go.
I've tried this from an IPython shell:
In [5]: easy_install.main( ["-U","frida"] )
And the package install successfully, but IPython still gave an error when importing it.
pip doesn't find the package.
I seem to be missing something with the IPython packages - How does one install packages to IPython?
If you are working in virtualenv, then installing IPython into virtualenv resolve such problems.
Usually, IPython is giving this advice when it start inside of virtualenv.