rstudio / vetiver.posit.co

Website for the vetiver 🏺 framework
https://vetiver.posit.co/
12 stars 8 forks source link

Error in Dockerfile section - Python... #52

Closed coforfe closed 1 year ago

coforfe commented 1 year ago

Hi,

I got a constant error when using:

vetiver.write_docker(app_file)

The error says "name 'vetiver' is not defined"

but it worked by doing this:

from vetiver import write_docker
write_docker(app_file)

Please could you check if this is fine?

Thanks, Carlos.

isabelizimm commented 1 year ago

Hi Carlos,

Thanks for the feedback! When you are getting this error, how have you imported vetiver? This sounds like it could be an issue with namespaces. For example, if you were to run:

from vetiver import VetiverModel

vetiver.write_docker()

the error NameError: name 'vetiver' is not defined is expected, since your environment will only have VetiverModel, not all the vetiver functions. But, if you run something like

import vetiver

vetiver.write_docker()

it should run as expected since all of vetiver would be imported.

coforfe commented 1 year ago

Hi Isabel,

OK. Thanks!. Yes it works fine!.

isabelizimm commented 1 year ago

Awesome, glad to help!