'ModuleNotFoundError' Jupyter Notebook even though module was installed with pip - pip

I am trying to run some code in jupyter notebook which needs the module 'CTRNN' installed. I can not install with conda, so I installed with pip (which are the instructions on the pypi page for ctrnn module anyway). However, even though I can see the ctrnn module is installed within the env I am using, I still get this error message.
The environments also match up with where ctrnn was installed
Jupyter notebook:
active environment : tf
active env location : /Users/logan/opt/miniconda3/envs/tf
Path of ctrnn install:/Users/logan/opt/miniconda3/envs/tf/lib/python3.7/site-packages
What is going on here? I have no idea how to fix this. Any help greatly appreciated!

Related

kedro jupyter notebook in command prompt returns kedro.framework.cli.jupyter.single kernelspec manager' could not be imported"

I have been trying to activate jupyter notebooks in a kedro context for over 24 hours now and I receive the same error all the time. I have searched around and no one seems to be able to solve this problem. I have created a jupyter_notebook_config.json as recommended by some and deleted it as recommended by others and there is no change.
I have installed ipython and run $python3 -m ipykernel install --user --name=myvenv
this successfully installed kernelspec within my venv but still when i run
kedro jupyter notebook
i get the following error
[C 08:50:49.028 NotebookApp] Bad config encountered during initialization: The 'kernel_spec_manager_class' trait of <notebook.notebookapp.NotebookApp object at 0x7fdef3120a90> instance must be a type, but 'kedro.framework.cli.jupyter.SingleKernelSpecManager' could not be imported
Can anyone direct me on how to approach this as it is preventing me from conducting my work in jupyter.
note that kedro jupyter and kedro jupyter lab and kedro ipython work just fine. The issue seems limited to notebook
I have tried
https://github.com/kedro-org/kedro/issues/184
https://github.com/jupyter/notebook/issues/2875
Running jupyter lab in kedro project in vscode under windows not possible
none of these resources helped. Any guidance is appreciated
After some time on this. My manager asked to run jupyter --version turns out that notebook was not installed.
while not a solution for everyone, it warrants a check to ensure that notebook is installed. Though this does not explain how i was able to access and work in notebook prior to noticing this issue

No Module Found "elasticsearch"

Installed elasticsearch by pip but notebook was throwing error like no module found.
i got it fixed by restarting the jupyter notebook. but iam curious how it fixed the problem
It is probably a problem with environments. The jupyter notebook you previously used, did not use the same Python environment as where you've installed elasticsearch. You can always check which version you are using with
which python
in your terminal. Or the Windows CMD equivalent
where python

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

difference between conda install and pip install in jupyter notebook

I'm a little confused with package install in anaconda environment.
I can install my python packagse in the following ways.
open anaconda prompt and do : conda install tensorflow
launch an jupyter notebook from anaconda prompt, choose the default python kernel, and do:
!pip install tensorflow
Can someone tell me what is the difference between these two cases? Where are the python packages installed? What happens when I pip install python packages in default kernel in jupyter notebook?
I was able to install tensorflow in jupyter notebook in default kernel (python3), but trying to import tensorflow give me module note found error. Does anyone know why that happened? What is happening under the hood? Very much appreciate any help to clarification.
pip is the default package manager that ships with python. Conda is also a package manager, but it is third party. Conda was made especially for data science libraries. Libraries installed with conda usually give much better performance than pip. In pip, the packages are stored in python/scripts and conda stores them at /anaconda/pkgs/. As for the module not found error. I would need more information about it, but you can check out this video. I learnt how to install TensorFlow here and would highly recommend it.

Error no module named tensorflow in Anaconda for mac

I installed tensorflow as described for Anaconda installation in the tensorflow.org. I could run the tensorflow in the Mac terminal just typing,
$ source activate tensorflow
$ python
import tensorflow as tf
But, when I run iPython notebook, it does not work by showing an error of no module named tensorflow. I felt like tensorflow was correctly installed but iPython notebook could not recognize it. Is there any way to fix it?
Please have a look at your path. When you do the command 'source activate tensorflow', your path may have changed. The example is following.
sherrie#sherrie-PC:~/tensorflow/tensorflow/examples/udacity$ source activate tensorflow
discarding /home/sherrie/anaconda2/bin from PATH
prepending /home/sherrie/anaconda2/envs/tensorflow/bin to PATH
Tensorflow is installed in the first path, instead of the second one.
The most important step comes. Open your directory of 'anaconda' --> find the 'envs' --> open 'tensorflow' --> copy all files in 'sitepack0ages' to 'anaconda/lib/python2.7/sitepack-ages'. Done.
My answer is based on this other answer: Trouble with TensorFlow in Jupyter Notebook. I had the exact same problem, and I solved it by doing this:
Once your environment is activated, run "which jupyter" and verify if the path returned points to the /bin folder under your environment, something like /my_environments_path/my_tensorflow_environment_name/bin/jupyter. If this is already the case, your scenario is different from the one I had;
Run "which pip" and/or "which pip3". Odds are, you are executing pip or pip3 from a different location, so Jupyter is not being installed inside your environment. In my case, Python version was 3.6, but pip3 was being called from a different location. I ran "pip install jupyter", since pip was inside the /bin folder in my environment. Once I called the correct pip, I checked again the "which jupyter" command, and this time Jupyter was under my environment and I could import Tensorflow inside my notebooks. If no pip's path points to your environment, install pip inside it by running "conda install pip".
I hope this works, along with the additional information on the link above.

Resources