I have installed h2o package on anaconda python, however, I get the following error on jupyter notebook:
import h2o
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-accdebc0c7de> in <module>
----> 1 import h2o
ModuleNotFoundError: No module named 'h2o'
From the conda list I can see that the installed h2o version is the following:
conda list h2o
#
# Name Version Build Channel
h2o 3.18.0.2 0 anaconda
(Is it normal that the build version is 0 here?)
The python version is 3.7.4.
I also tried the following
conda install -c h2oai h2o
and I get
# All requested packages already installed.
Any ideas why the h2o package isn't working?
Thanks for your time!
AMC, regarding the anaconda environments, after running:
conda info --envs
I get:
# conda environments:
#
base * C:\Users\ncham***\AppData\Local\Continuum\anaconda3
As far as I can see, there is only one environment...
Here is the official guide for installing H2O on Anaconda.
Jump to the Install on Anaconda Cloud part, make sure your Python's version is compatible with h2o module (2.7,3.5 and 3.6), follow the steps and you will be able to import h2o module through py36 channel.
Hope this answer helps you.
Related
I'm very sorry, this question has popped up quite a few times, yet I'm still struggling. I'm using Windows 11. I've installed Anaconda Navigator, created a new environment, and installed the required module (MDAnalysis, via Anaconda Navigator). I launched Juypter Notebook from the play icon of the desired environment inside Anaconda Navigator.
Then with the code:
import sys
print(sys.executable)
#!pip install mdanalysis
import mdanalysis as md
Which returns the error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In [1], line 6
1 import sys
2 print(sys.executable)
3
4 #!pip install mdanalysis
----> 6 import mdanalysis as md
ModuleNotFoundError: No module named 'mdanalysis'
As you can see, from printing out the sys.executable and checking whether mdanalysis is installed (it is; hence I commented the pip line out), I've tried attempts mentioned elsewhere in StackOverflow with no success.
The executable is:
C:\Users\yewro\anaconda3\envs\MinesMD\python.exe
Where MinesMD is the conda environment, I (a) installed MDAnalysis from Anaconda Navigator, and (b) I launched Jupyter Notebook.
I would appreciate any help/suggestions.
EDIT
I've just tried installing MDAnalysis via conda inside Jupyter Notebook. I shouldn't need to do this as I did it within Anaconda Navigator (and with the right environment), but in for a penny, in for a pound. This is the output (matching python executable location and environment):
C:\Users\yewro\anaconda3\envs\MinesMD\python.exe
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
# All requested packages already installed.
Retrieving notices: ...working... done
Try installing the missing package directly from the Jupyter Notebook (with pip or conda) as explained here:
https://jakevdp.github.io/blog/2017/12/05/installing-python-packages-from-jupyter/
EDIT:
We figured out that the package was correctly installed and accessible to the Jupyter Notebook environment. (See comments for this answer)
The problem is that the modules import should be different: import MDAnalysis instead of import mdanalysis.
I am trying to download Google Cloud DLP on my Mac M1 running macOS Monterey. I am using Python 3.10.4 and pip 22.0.4.
I first tried using pip install google-cloud-dlp, but got an error when I went to import it that I have the wrong architecture (arm instead of x86-64 – hence M1 error).
I then uninstalled DLP and followed the advice of a StackOverflow post to download the library directly from GitHub. I did this, navigated to the directory, and ran sudo python3 setup.py install.
Now, when I try to import the library, I get the error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [57], in <cell line: 1>()
----> 1 import google.cloud.dlp
ModuleNotFoundError: No module named 'google.cloud.dlp'
This is odd because when I run pip list I get this in the output:
google-api-core 2.7.2
google-auth 2.6.6
google-cloud-dlp 3.6.2
googleapis-common-protos 1.56.0
Now, when I run pip install google-cloud-dlp, I get a bunch of "Requirement already satisfied" messages, yet when I try to import, I get a ModuleNotFoundError.
I have tried importing in Atom, VSCode, and Jupyter-Notebook, and still get a ModuleNotFoundError. I feel dumb asking this question because it seems like it would be an easy fix, but any help is appreciated.
One potential issue is that you have multiple python versions installed. Is it possible that the script ran under in a different Python environment than the one used to print the installed versions?
Could you try following these steps?
Create virtualenv.
python3 -m venv env
source env/bin/activate
Install google-cloud-dlp.
pip install google-cloud-dlp
Run code.
$ python3
>>>import google.cloud.dlp
>>>
If you're still having trouble, try the steps on another environment like Cloud Shell to rule out an issue with your specific environment.
I am running on windows 10. I am having problems with importing TensorFlow. I am in Vs code. I installed tensorflow using pip3. And here is the error:
Traceback (most recent call last):
File "c:/Users/USER/PycharmProjects/tt/main.py", line 1, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
I created my project in pycharm.
I am using python 3.7.5 and TensorFlow 2.0.0. This is how I installed TF:
pip3 install tensorflow==2.0.0
please help I was having this problem for a week.
Thanks , In Advance
For your work/project, please try to create a new virtual environment and then install all your required packages.
Like this:
$ python3 -m venv env
Activate it:
$ source env/bin/activate
and then install the tensorflow package inside your virtual environment:
pip3 install tensorflow
I think you need to create environment separate
and then install tensorflow..
for more information regarding envirnoment Link
Do you have several different python environments on your pc? Which python interpreter are you using when you install tensorflow?
The Status Bar will show you the current interpreter in the lower left corner. Check whether it is the same with the one you use when you install tensorflow.
enter image description here
I was getting your exact error, but this worked for me:
File->settings
Workspace tab
Search for "interpreter"
Put the complete path to the python.exe you want to execute under "default interpreter path"
It seems VSCode either found (or included) an older version of python that couldn't find the things I installed with pip.
I am a bit of a python newb and I'm guessing the venv approach is superior, but I couldn't get that cooperating with VSCode on windows.
I got this error in Jupyter Notebook.
this may duplicate post but no any proper answer found
Neither below links helped me to solve this.
No module named tensorflow in jupyter
No module named tensor flow -- iPython notebook
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-b88de1945047> in <module>()
1 get_ipython().magic('matplotlib inline')
2 import numpy as np
----> 3 import tensorflow as tf
4 from tensorflow.contrib import rnn
5 import data_loader
ModuleNotFoundError: No module named 'tensorflow'
B:S -
enter image description here
I faced the same problem at first. I realized that in the conda-->envs -->
tensorflow-->Scripts-->idle.exe, is the python 3.5.5 shell. Where you can import tensorflow without any problems. So, I chaged the directory as C:\Users\Temp\Anconda3..... and then activated and deactived the tensorflow once. In the next step I entered the python mode and import tensorflow as tf worked right.
I had the same problem and I think I've found the solution!
See, I had installed both CPU and GPU versions of Tensorflow at the same time which apparently is wrong. Then, I uninstalled the GPU version, it didn't work this time either. So I uninstalled both of them and reinstalled the CPU version. It's working now.
BTW I'm on Win10(1803) and python 3.6.5 (not using anaconda.)
You can execute the following instructions and command to solve the issue: (do not include inverted commas)
Open Anaconda Prompt
type: "create --name py3-TF2.0 python = 3"
press "y" to continue
After successful completion:
type "conda activate py3-TF2.0"
type "pip install matplotlib"
type "pip install tensorflow==2.1.0"
type "conda deactivate"
type "pip install ipykernel"
type "conda install nb_conda_kernels"
Now exit the Anaconda prompt and open the Anaconda Navigator application. Switch to "py3-TF2.0" from the base environment using the Environment tab. Install Jupyter in the specified environment.
After successful installation, open Jupyter notebook and switch to "py3-TF2.0" kernel using Kernel Tab.
You're good to go for using TensorFlow 2.
Make Sure you use Anaconda 2020.02 or lower version.
As new version does not support TensorFlow 2.
I have been trying to install Lasagne and Theano in Anaconda (Jupyter) on MacOS Sierra (10.12.3) to use this neural network: neural-storyteller
However when I try to import them in Jupyter:
import lasagne
import theano
I get this error:
ImportError Traceback (most recent call last)
<ipython-input-2-7d877a974cd7> in <module>()
----> 1 import lasagne
2 import theano
//anaconda/lib/python2.7/site-packages/lasagne/__init__.py in <module>()
11 section 'Install from PyPI' in the installation docs for more details:
12 http://lasagne.readthedocs.org/en/latest/user/installation.html#install-from-pypi
---> 13 """)
14 else:
15 del theano
ImportError: Could not import Theano.
Please make sure you install a recent enough version of Theano. See
section 'Install from PyPI' in the installation docs for more details:
http://lasagne.readthedocs.org/en/latest/user/installation.html#install-from-pypi
My guess is that I installed Theano on a different version of python because when I make a normal python file (.py) and import lasagne and theano they work. Also, when I look in the anaconda folder in the User directory there is no theano folder but there is one in the miniconda2 folder (/Users/Pit/miniconda2/pkgs/theano-0.9.0-py27_0).
I could just use a .py file, but I also need the caffe library which I could only get to work with Anaconda python.
Does anybody know how to install the right version of theano that works in Anaconda (Jupyter)?
Any help would be much appreciated
I had faced the same issue. I think it's because Theano installation was not proper. So here is what I did and it started working after that :
In Anaconda Prompt
conda install theano
Follow through the installation. It would probably ask for some confirmations.
Then,
pip install -r https://raw.githubusercontent.com/Lasagne/Lasagne/master/requirements.txt
After that,
pip install https://github.com/Lasagne/Lasagne/archive/master.zip
I think that should do the trick. It started working after that in my case. Restart the kernel once.
For more context : https://pypi.org/project/Lasagne/
You should check which jupyter and which python is being called by using the command:
which python
If you do:
which jupyter
they should be in the same directory. For example:
$:/home/spark : which jupyter
~/anaconda2/bin/jupyter
$:/home/spark : which python
~/anaconda2/bin/python
If they're not the same, then that could explain why you cannot import some libraries (because they're installed under a different python instance).
Unless you need both, I would remove either anaconda or miniconda to make things simpler and less confusing.
Theano works fine with Anaconda and in Jupyter in my experience.