Open tsdobbs opened 2 years ago
I suspect it's a red herring, but if it's useful, here is the Dockerfile I used:
# syntax=docker/dockerfile:1
FROM jupyter/minimal-notebook
USER root
RUN apt-get update && \
apt-get install -y gcc graphviz
# set environment variables
ENV APP_HOME=/usr/src/app
ENV PYTHONDONOTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# set working directory
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
# add and install requirements
COPY . .
RUN pip3 install .
# set up jupyter to run on port assigned to dyno
CMD jupyter lab --config=./jupyter_config
The file references a jupyter_config.py file, which just makes a few config changes to allow it to be deployed on the cloud. It contains the following:
import os
c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline' # if you want plotting support always in your notebook
# Notebook config
c.NotebookApp.notebook_dir = 'notebooks'
c.NotebookApp.allow_origin = u'IP ADDRESS' # replaced with public ip address
c.NotebookApp.ip = '*'
c.NotebookApp.allow_remote_access = True
c.NotebookApp.open_browser = False
# ipython -c "from notebook.auth import passwd; passwd()"
c.NotebookApp.password = u'PASSWORD' #replaced with hashed password
c.NotebookApp.port = int(os.environ.get("PORT", 8888))
c.NotebookApp.allow_root = True
c.NotebookApp.allow_password_change = True
c.ConfigurableHTTPProxy.command = ['configurable-http-proxy', '--redirect-port', '80']
Both files are in the top-level paml directory. I run docker build -t paml .
to build the image and docker run -e PORT=8888 -p 8888:8888 paml
to run it.
I'm pretty sure this will be addressed by fixing #78 : rdflib has been a bit of a moving target thanks to their recent major version change, and once we make the transition from 5 to 6 I suspect it will simplify.
@bbartley : I've marked #78 as critical
@tsdobbs I've upgraded PAML to use rdflib 6 -- please see if this update resolves your installation errors and please let me know if it doesn't!
Thanks @bbartley. It is importing now, at least on the Heroku dyno I tested it on.
It looks now like paml_check isn't importing though. Possibly related?
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [19], in <module>
9 from IPython.display import Markdown
12 from paml.execution_engine import ExecutionEngine
---> 13 from paml_check.paml_check import check_doc
14 from paml_convert.markdown.markdown_specialization import MarkdownSpecialization
16 get_ipython().run_line_magic('load_ext', 'autoreload')
ModuleNotFoundError: No module named 'paml_check'
I propose a good metric for testing if all imports are working is if everything imports properly on the Google CoLab Notebook. If it works there, then at least we know that it can work on a fresh machine with minimal other dependencies.
Hi @tsdobbs I recently made the paml-check
utility an "extra" option upon installation -- since it requires the z3 solver which doesn't build on all systems.
I've updated the README with these instructions as well.
If we were able to get PAML to run on anaconda, that might be a Good Thing, since
conda has a Z3 package, which means that installing paml-check
will be easier.
I'm afraid I don't really understand conda packaging -- I just have had to use conda on some projects for data analysis because it makes installing the mkl libraries not impossible...
@rpgoldman I've moved the conda question to a new issue, since we need to be operational outside of conda as well.
@tsdobbs Is there anything remaining to be done to resolve this issue, or can it be closed?
This is inconsistent, but has shown up enough on different systems that it's worth reporting. After installation via
git clone ...
andpip3 install .
, importing paml inside of a python environment withimport paml
produces this error:The error appears related to the rdflib import, and I see there are already outstanding issues ( #78 ) and PRs ( #79, #82 ). Perhaps this is related?
Regardless, most of my team initially gets this error once they've installed paml, but are sometimes able to fix it by trying a seemingly-random collection of installs and uninstalls of various packages inside and outside of virtualenvs, conda environments, and even Docker containers. Two anecdotes:
The desired behavior is, of course, that paml imports with no errors on all machines.