# Error import streamlit

**URL:** <https://discuss.streamlit.io/t/error-import-streamlit/554>\
**Category:** Using Streamlit\
**Tags:** windows\
**Created:** [October 17, 2019, 10:23am UTC](https://discuss.streamlit.io/t/error-import-streamlit/554 "2019-10-17T10:23:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![isaco](https://avatars.discourse-cdn.com/v4/letter/i/c89c15/32.png) [@isaco](https://discuss.streamlit.io/u/isaco)\
**Post date:** [October 17, 2019, 10:23am UTC](https://discuss.streamlit.io/t/error-import-streamlit/554/1 "2019-10-17T10:23:13Z")

</div>

error:  
TypeError: **init** () got an unexpected keyword argument ‘serialized\_options’  
when import streamlit in python3 , w10, anaconda jupyter or cmd console to run py program?  
What is solution (step ba step, mybe versions)?  
Thanks in advance ,  
Isaco

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/thiago/32/22_2.png) [@thiago](https://discuss.streamlit.io/u/thiago)\
**Post date:** [October 20, 2019, 9:35pm UTC](https://discuss.streamlit.io/t/error-import-streamlit/554/2 "2019-10-20T21:35:22Z")

</div>

Hi @isaco

A few questions:

1. What script are you trying to run when you see that error? Is it `streamlit hello`? Or is it a script you wrote?
2. If a script you wrote, can you paste it here?
3. Can you share the full error? There are usually some lines above the one you sent, which are important to help debug it.

Thanks!

---

<div class="post-metadata">

**Author:** ![isaco](https://avatars.discourse-cdn.com/v4/letter/i/c89c15/32.png) [@isaco](https://discuss.streamlit.io/u/isaco)\
**Post date:** [October 21, 2019, 7:22am UTC](https://discuss.streamlit.io/t/error-import-streamlit/554/3 "2019-10-21T07:22:03Z")

</div>

Hi Thiago,

1. both not working: streamlit hello.py, and example slider.py:

2. slider.py:

import streamlit as st

x = st.slider(‘x’)  
st.write(x, ‘squared is’, x \* x)

V V ned., 20. okt. 2019 ob 23:45 je oseba Thiago Teixeira via Streamlit [streamlit@discoursemail.com](mailto:streamlit@discoursemail.com) napisala:

---

<div class="post-metadata">

**Author:** ![isaco](https://avatars.discourse-cdn.com/v4/letter/i/c89c15/32.png) [@isaco](https://discuss.streamlit.io/u/isaco)\
**Post date:** [October 21, 2019, 7:29am UTC](https://discuss.streamlit.io/t/error-import-streamlit/554/4 "2019-10-21T07:29:39Z")

</div>

Hi Thiago,

1. both not working: streamlit hello.py, and example slider.py ?

2. slider.py:

import streamlit as st

x = st.slider(‘x’)  
st.write(x, ‘squared is’, x \* x)

1. error in jupyter (anaconda, w10, python 3.6.5):

TypeError Traceback (most recent call last)

```auto
<ipython-input-1-1aa3dc4fa683> in <module>
----> 1 import streamlit as st
~\Anc3\lib\site-packages\streamlit\ __init__.py in <module>
     94 from streamlit import util as _util
     95 from streamlit.ReportThread import get_report_ctx, add_report_ctx
---> 96 from streamlit.DeltaGenerator import DeltaGenerator as _DeltaGenerator
     97
     98 # Modules that the user should have access to.

~\Anc3\lib\site-packages\streamlit\DeltaGenerator.py in <module>
     33 from streamlit import caching
     34 from streamlit import metrics
---> 35 from streamlit.proto import Balloons_pb2
     36 from streamlit.proto import BlockPath_pb2
     37 from streamlit.proto import ForwardMsg_pb2
~\Anc3\lib\site-packages\streamlit\proto\Balloons_pb2.py in <module>
     20 syntax='proto3',
     21 serialized_options=None,
---> 22 serialized_pb=_b('\n\x1estreamlit/proto/Balloons.proto\"\x8e\x01\n\x08\x42\x61lloons\x12\x1c\n\x04type\x18\x01 \x01(\x0e\x32\x0e.Balloons.Type\x12\x14\n\x0c\x65xecution_id\x18\x02 \x01(\r\"N\n\x04Type\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x0b\n\x07\x42\x41LLOON\x10\x01\x12\x0e\n\nHAPPY_FACE\x10\x02\x12\r\n\tSTAR_FACE\x10\x03\x12\r\n\tCOOL_FACE\x10\x04\x62\x06proto3')
     23 )
     24

TypeError: __init__ () got an unexpected keyword argument 'serialized_options'

```

```auto

```

```auto
3. attached error in CMD (the same)

```

```auto

```

```auto
Maybe versions, I done a lot of pip instalation of other packages (tensorflow (2.0), keras...).

```

```auto
Please advice me to solve the error! Thank you in advance, Isaco

```

V V pon., 21. okt. 2019 ob 09:22 je oseba Isaco Val [myisaco@gmail.com](mailto:myisaco@gmail.com) napisala:

 ![streamlit err.PNG](https://global.discourse-cdn.com/streamlit/original/1X/1c52bcd81e606b203466341ca043ab8f19b87d3e.png)

---

<div class="post-metadata">

**Author:** ![tim](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/tim/32/101_2.png) [@tim](https://discuss.streamlit.io/u/tim)\
**Post date:** [October 29, 2019, 8:50pm UTC](https://discuss.streamlit.io/t/error-import-streamlit/554/5 "2019-10-29T20:50:55Z")

</div>

Hi @isaco - it sounds to me like your Python environment might have conflicting packages in it.

Could you try running streamlit from within a clean virtualenv? Here’s how you can set that up, assuming you’re using python3 on Windows:

1. Create a new virtual environment called ‘venv’: `python3 -m venv venv`
2. Activate your venv: `venv\Scripts\activate.bat`
3. Install streamlit into your virtualenv: `pip install streamlit` (note that, since you activated your virtualenv in step 2, `pip install` will put streamlit and its dependencies into your venv, rather than in the global python packages directory).
4. Run streamlit: `streamlit hello`

If you prefer Anaconda, or are already using it, this page is useful for getting up to speed on creating a new Anaconda environment: [https://docs.anaconda.com/anaconda/navigator/tutorials/manage-environments/](https://docs.anaconda.com/anaconda/navigator/tutorials/manage-environments/)

(And you can read more about venv creation in the Python docs, here: [https://docs.python.org/3/library/venv.html](https://docs.python.org/3/library/venv.html))

In general, installing everything into your global Python packages is bad practice, because it can result in all sorts of conflicts. In the case of your error, it looks like there may be a conflict in `protobuf`, a common library that Streamlit uses for data serialization. I wonder if you’d previously installed another package that uses a different version of protobuf?

After trying the above steps, if you’re still having issues, please feel free to post back here with your results!

---

<div class="post-metadata">

**Author:** ![tim](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/tim/32/101_2.png) [@tim](https://discuss.streamlit.io/u/tim)\
**Post date:** [October 29, 2019, 9:20pm UTC](https://discuss.streamlit.io/t/error-import-streamlit/554/6 "2019-10-29T21:20:08Z")

</div>

@isaco - as a potential, quicker workaround: you could also try `pip install --upgrade protobuf` to get the latest protobuf dependency, without setting up a clean virtual environment.

If this doesn’t solve your problem, then I’d suggest going through the virtualenv steps above!

---

<div class="post-metadata">

**Author:** ![Amirabbas\_Mehrdad](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/amirabbas_mehrdad/32/5005_2.png) [@Amirabbas\_Mehrdad](https://discuss.streamlit.io/u/Amirabbas_Mehrdad)\
**Post date:** [January 7, 2021, 5:03pm UTC](https://discuss.streamlit.io/t/error-import-streamlit/554/7 "2021-01-07T17:03:22Z")

</div>

It worked for me, Thanks man.

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [February 7, 2022, 3:52pm UTC](https://discuss.streamlit.io/t/error-import-streamlit/554/8 "2022-02-07T15:52:15Z")

</div>


