Error importing anvil.server in AWS SageMaker Jupyter notebook

i tried to import anvil.server and i got the following error. i have installed anvil-uplink and i am able to import anvil as well. but not able to import anvil. server.


AttributeError Traceback (most recent call last)
in ()
----> 1 import anvil.server

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/anvil/server.py in ()
5
6 import anvil
----> 7 from . import _server, _serialise, _threaded_server
8 from ._threaded_server import live_object_backend, LazyMedia
9

~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/anvil/_server.py in ()
21 _value_types = {}
22
—> 23 class LiveObjectProxy(anvil.LiveObject):
24
25 def init(self,spec,known_methods=None):

AttributeError: module ‘anvil’ has no attribute ‘LiveObject’

Hi there! This looks interesting - I haven’t seen that error before!

Can you tell me a bit more about your SageMaker configuration? Are you using the stock configuration? Are you using a particular kernel? What packages have you installed over and above the SageMaker defaults?

I just launched a SageMaker instance (with the default conda_tensorflow_p36 kernel) and pip installed anvil-uplink, and it seemed to work for me:

So we need to find what about your configuration is different!

this is what its showing now ! a SageMaker (p2.xlarge) instance instance (with the default conda_tensorflow_p36 kernel) and pip installedanvil-uplink`. but it still says anvil module not found.

Can you show us the output of the command:

!pip install anvil-uplink

please?

(Like what I did in my screenshot above)

Just in case it helps: this reminds me of an environment that I broke long time ago after doing pip install anvil. I deleted the environment, created a new one, did pip install anvil-uplink and everything worked well.

@stefano.menci – Aha! If that’s the case, then !pip uninstall anvil should help you out!

I just ran into the same problem installing anvil-uplink in a virtual environment I’ve had for a while. I created a new virtual environment, pip installed anvil and anvil-uplink in it and now they’re importing into my jupyter notebook without any problem.

1 Like