You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I was unsuccessfully trying to install lnn lib in Google Colab with and without conda use. The issue with conda approach consists in non-activation of the newly created lnn-env even within the same cell, and the lnn package is not visible to python.
The pip3 approach wouldn't work, as the default version of pathlib-1.0.1does not contain the attribute read_text for PosixPath.
Code to reproduce conda approach:
# Get miniconda and install Python 3.9
!wget -O mini.sh https://repo.anaconda.com/miniconda/Miniconda3-py39_4.9.2-Linux-x86_64.sh
!chmod +x mini.sh
!bash ./mini.sh -b -f -p /usr/local
!conda install -q -y jupyter
!conda install -q -y google-colab -c conda-forge
!python3 -m ipykernel install --name "py39"
# Install graphviz
!sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config
!sudo -H apt-get install libgmp-dev python3-dev
# Create virtual environment and activate it - all in one cell, but the activation doesn't work
!conda create -n lnn-env python=3.9 -y
!source activate lnn-env
!conda activate lnn-env
!python --version
!conda info --envs
!pip install git+https://github.com/IBM/LNN.git
from lnn import Proposition
Messi = Proposition("Messi")
AFC = Proposition("Argentina National Football Club(AFC)")
which shows that conda init didn't work and the newly created environment doesn't have the asterix of activation:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
Python 3.9.1
# conda environments:
#
base * /usr/local
lnn-env /usr/local/envs/lnn-env
finally, the lnn library does not exist to python compiler:
ModuleNotFoundError Traceback (most recent call last)
[<ipython-input-1-d11eb96f34b4>](https://localhost:8080/#) in <module>()
7 get_ipython().system('pip install git+https://github.com/IBM/LNN.git')
8
----> 9 from lnn import Proposition
10 Messi = Proposition("Messi")
11 AFC = Proposition("Argentina National Football Club(AFC)")
ModuleNotFoundError: No module named 'lnn'
I also couldn't install it, which made me create a docker container for it and run notebooks on Jupyter UI. For now, it's available here, and merge request #67 is created for it.
Hello, I was unsuccessfully trying to install lnn lib in Google Colab with and without conda use. The issue with conda approach consists in non-activation of the newly created lnn-env even within the same cell, and the lnn package is not visible to python.
The pip3 approach wouldn't work, as the default version of pathlib-1.0.1does not contain the attribute
read_text
forPosixPath
.Code to reproduce conda approach:
which shows that
conda init
didn't work and the newly created environment doesn't have the asterix of activation:finally, the lnn library does not exist to python compiler:
The code for pip3 approach:
which results in an error from the logs:
AttributeError: 'PosixPath' object has no attribute 'read_text'
The text was updated successfully, but these errors were encountered: