I have installed imblearn using pip in command in command line and I'm able to import imblearn in python console. but when i use import imblearn in jupyter i'm getting error "ModuleNotFoundError: No module named 'imblearn'".
I know there are many answers in stackoverflow but nothing has worked. Thats the reason i'm posting new question.
I tired differnt option like.
installing !pip install imblearn in jupyter itself and restarted the kernel.
and updating sklearn in jupter.
Please let me know if any other way is there to solve this issue or any other details is required.
Related
from gensim.models import Word2Vec
results in the following error
ImportError: cannot import name 'Word2Vec' from 'gensim.models' (unknown location)
from gensim.models.word2vec import Word2Vec
results in the same error
After deleting all conda installations of this package, pip uninstalling gensim, pip installing gensim and pip install --upgrade gensim, I can finally do
import gensim
but when I try to use gensim.models.Word2Vec it results in the error:
AttributeError: module 'gensim.models' has no attribute 'Word2Vec'
Edit: updated Numpy and Scipy as well
Note: I am using a jupyter notebook that I run from my local machine. I have not had this problem using Pycharm where I was running gensim from a conda env (but I'm working on a group project in notebook so it would be nice if I didn't constantly have to copy paste between these 2 workspaces...)
Any help would be appreciated
First, try to restart your kernel after the installation and see if it works. Then, check that your are in the right virtual environment. Then, please check you gensim version. In a notebook cell run
import gensim
gensim.__version__ # should be 4.1.2. If it's not update via pip.
You can also manually inspect if gensim.models.word2vec is actually there. In a notebook cell run
gensim.__path__
and go to the folder. Here you can see if there's indeed a folder named models and a script named word2vec. If not, there's something wrong with your installation. Hope this helps a bit.
After I installed zipline with the anaconda prompt everything was imported and installed correctly. But in the Jupyter notebook, I am getting error like no module called 'matplotlib' or pandas 'DataReader' is not working. When I try to install it in the notebook and restart the kernel, the zipline import is no longer working. How can I solve this? What is wrong with the zipline installation?
zipline has very specific dependencies like pandas 0.18.0 and pandas DataReader 0.8.0. So make sure you have the correct version of those. And by the way, I find the tutorial here very useful.
Hope it could help
I have been trying to utilise mutual_info_regression method from sklearn, I have updated sklearn to latest build which is 0.24.1 and when I checked the source code inside my conda env path there is folder and files for feature_selection.mutual_info_regression, but when I try to import it in my Jupiter notebook it throws this error ImportError: cannot import name 'mutual_info_regression' from 'sklearn.model_selection' (/opt/anaconda3/envs/<my_env>/lib/python3.8/site-packages/sklearn/model_selection/__init__.py)
I tried restarting kernel as well, but it is still not working, has anyone else faced this issue? Im using macOS 11.2.1 and conda 4.8.3 with Python3
Thanks
I found the solution,
I just had to restart my terminal and then it started working for some reason.
I hope this helps anyone facing such problem in future
Thanks SO!
import sklearn
print(sklearn.__version__)
Check your sklearn version sklearn.model_selection is only available for version 0.18.1
Then try this in Jupyter Notebook cell
from sklearn.feature_selection import mutual_info_regression
If any of the above doesn't work try these three steps
1- pip uninstall sklearn
2- pip uninstall scikit-learn
3- pip install sklearn
I am going to use Bindsnet for Spiking Neural Network and I have imported it using
! pip install bindsnet in jupyter notebook.
and My Python's version is 3.6.
when I run:
from bindsnet.network import Network
It returns below error message:
ModuleNotFoundError: No module named 'bindsnet.network'
Can you please let me know how to solve this?
It turned out that using pip install was not successful so I changed the code for installation to :
!pip install bindsnet --ignore-installed
and now I can run from bindsnet.network import Network with no error.
When I try to import tensorflow my python crashes. I tried uninstalling it and installing it again, but It isn't still working. Here is a picture of the command prompt when I try to import it.
I'm not too sure what the error is here.
try to pip list to see all packages
if no tensorflow seen then just pip install tensorflow
or print dir(tensorflow) to see functions
It seems you aren't executing anything but just importing the module.