Cannot run a python package in amazon sagemaker, but can run it in amazon terminal? - terminal

I am trying to use https://github.com/amzn/pecos in amazon sagemaker. I follow the readme of pecos to install it using amazon terminal. Then one can see the package is installed from terminal:
However, the package can not be used in a sagemaker:
So, why this happened and how to fix it?
P.S. I use the same way to install https://github.com/facebookresearch/fastText and it can run in a sagemaker jupyter notebook.

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

How do I clone a Google Colab environment to a local Anaconda environment on Windows?

I have a notebook that works fine in Google Colab. I am not able to properly create an Anaconda environment with the packages due to dependency issues. Is there a way to install all required packages from colab to local Windows Anaconda environment? Using pip freeze gives a list that is appropriate for Linux but not for windows
In google Colab, run the following code:
!pip freeze >> requierements.txt
All the packages that were installed will appear here to be downloaded
Later on, on your localhost run,
pip install -r requierements.txt

Superuser for Google Colab Notebooks

I wanted to use to add some python packages using pip in my Google Colab Notebook terminal and also set my environment variable(a JSON file).
Where can I find a terminal so that I can do these tasks?
Is it even possible to run Google Colab Notebook as a superuser?
Colab notebooks execute as root on ephemeral VMs. You can run pip install and configure environment variables like so:
Pip install:
!pip install -q matplotlib-venn
Environment variables:
import os
os.environ['YOUR_VARIABLE'] = 'value'
Did you encounter a particular error attempting to do something specific?

'pip install duckling' giving issue

I want to install duckling to work on Rasa nlu training but it is giving issue as mentioned in below image please help me to fix this.enter image description here
As a suitable alternative would you consider running Rasa NLU in docker. The rasa/rasa_nlu:latest-full docker image includes duckling. If you wanted to get started with it and you have docker installed you should be able to just run
docker run rasa/rasa_nlu:latest-full
Then you can interact with Rasa over it's HTTP API https://github.com/RasaHQ/rasa_nlu#example-use
The docker file allow's more complicated setups like over writing the default config file and saving the logs/models/etc to a persistent disk
https://github.com/RasaHQ/rasa_nlu#advanced-docker
I had the same issue! This is basically the issue of jpype modules.
You need to first install the jpype in your environment.
you can use conda install -c conda-forge jpype1
For installing the jpype you can also refer to
official link for jpype installation.
On successful installation of jpype duckiling can be installed using
pip install duckling -U
I hope this would help!
You should download VC+ compiler for windows and then try the pip install.
You can download it here
https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi

Adding python libraries to google datalab environment

I'm using google datalab on google cloud platform. Worked great on the first try and I love how easy it is to now run a jupyter notebook server in the cloud (faster than starting up a localhost server). It's fantastic.
But now I want to install python libraries not included in the basic datalab environment (specifically I need the Bokeh plotting library).
So I opened a google cloud shell from the google cloud console where I manage this jupyter notebook instance, installed miniconda and then the bokeh library. Everything ran without error (e.g. bokeh installs several dependencies along the way), but my jupyter notebook on datalab (which can import other libraries like numpy) still gives me a "no module named bokeh.plotting" error.
Any ideas? Thanks in advance.
You can do this inside a notebook:
%%bash
pip install bokeh

Resources