Unable to import fiftyone in sagemaker jupyter notebook - jupyter-notebook

I am using python version 3.7.12 in sagemaker jupyter notebook.
I could do a !pip install fiftyone in the notebook but when I am trying to import fiftyone as fo it is giving me below error:
ConnectionError: Could not connect to 'mongod'
I have gone through its github repository but couldn't find a way to resolve this issue. And I tried implementing some of the answers provided for fiftyone's installation in Linux but it didn't work either.

Related

Jupyter Notebook not loading libraries

I have a conda virtual environment with Python 3.7.16 and several installed libraries such as 'lifelines', etc. In the conda console all the installed libraries are shown; however, when I open a Jupyter Notebook on the same environment and try to load, for example, the library 'lifelines', it gives me the error message ModuleNotFoundError: No module named 'lifelines'.
I have searched on Github and Stack Overflow, and tried several solutions such as this one and others, but I still can't import libraries on Jupyter Notebooks that are already installed in the conda environment.
Does anybody know how to solve this issue?
In fact, I needed to install Jupyter-lab and notebook in the same environment; otherwise it was searching for all libraries in the base one.

Jupyter notebook ModuleNotFound

I get this error when trying to execute the imports, i've tried to reinstall python3, ipython and jupyter-notebook, but i keep getting the error ModuleNotFound. I've tried googling and searching for an answer, but nothing has worked so far. I'm new to jupyter-notebook and need it for a course.
First, install matplotlib and numpy in your terminal:
pip install matplotlib #add "sudo" before "pip" when you get "Permission denied"
pip install numpy
Then, choose the right Python version(i.e. kernel) for your notebook.

can't import 'torchtext' module in jupyter notebook while using pytorch

I installed pytorch using anaconda3 and my created virtual conda environment named 'torchTest'.
I installed all the modules needed but, codes doesn't work in jupyter python.
I installed torchtext using
1.pip install https://github.com/pytorch/text/archive/master.zip
2.and also pip install torchtext too.
all I mentioned successfully downloaded in my MAC OS X, but can't get what's wrong with my Jupyter notebook..
After having the same issue with torchtext from within my jupyterlab, I opened an issue on Github at the jupyterlab project as well as at the torchtext repository.
My current solution is to add the PYTHONPATH from the Anaconda env.
The Anaconda path is usually like that $HOME/anaconda/bin
You can add it from within Jupyter Lab/Notebook like that:
import sys
sys.path.append("/some/path/to/add")
import torchtext

rpy2 import works in shell but not in jupyter notebook

So, I have installed rpy2 successfully, and I can import it in a python shell, for example. Also, I have Jupyter notebook successfully installed. But for some reason I cannot import rpy2 on the jupyter notebook. I get the standard 'module not found' error. Other posts have addressed problems relating to installation of rpy2 itself, but specifically, I can't import ONLY from jupyter notebook. I find it quite strange, because I'm fairly certain I only have one copy of Python 3.6, so why can it import in the terminal but not in the notebook. .. .
I solved this by re-installing jupyter notebook. . .
I encountered the same issue, and I use many different env with conda. Here is my solution, starting your jupyter notebook with the same env which rpy2 is installed.

Using a Jupyter imported library?

Here is the big question:
Do i need to explicitly install a library, such as Plotly, in order for my locally hosted Notebook to import it?
Yes you need to have the library installed in your local environment to import it into your Jupyter Notebook.
However, you can check whether a package exists from within Jupyter Notebook and also automatically install it if it isn't already available.
you can run pip as well as shell commands from within a cell of the notebook
The syntax is as follows !pip install plotly Here the ! explicitly forces the kernel to execute the command.
If it's already installed you'll get this message Requirement already satisfied: plotly in /opt/conda/lib/python2.7/site-packages

Resources