After upgrade to the latest version now this error id showing up **ArrowInvalid**

Still this bug did not been solved in version 1.0
Hope streamlit creators take care of it in order to take benefetis of the version 1.0 features.

I am also experiencing this issue. Rolled back to .84 but I actually also need session states, so this kinda sucks.

Yes you’re right this is sucks because there are a lot of new features in the latest version that can be very useful.
Hope that this issue is being debugued by streamlit’s creators

1 Like

Dear users,

If the workaround proposed above didn’t solve your issue, please use the approach described here.

This allows you to continue upgrading to the latest version of Streamlit and getting all the latest goodies!

Sorry for the inconvenience! We’re waiting for Arrow to fix this issue.

I tried to add this line is the config.toml but when i tried to run streamlit app it crash and display the below error:

Traceback (most recent call last):
  File "c:\users\lt gm\appdata\local\programs\python\python37\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\lt gm\appdata\local\programs\python\python37\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "F:\AIenv\lib\site-packages\streamlit\__main__.py", line 23, in <module>
    main()
  File "F:\AIenv\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "F:\AIenv\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "F:\AIenv\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "F:\AIenv\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "F:\AIenv\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "F:\AIenv\lib\site-packages\streamlit\cli.py", line 161, in main_run
    bootstrap.load_config_options(flag_options=kwargs)
  File "F:\AIenv\lib\site-packages\streamlit\bootstrap.py", line 318, in load_config_options
    config.get_config_options(force_reparse=True, options_from_flags=options_from_flags)
  File "F:\AIenv\lib\site-packages\streamlit\config.py", line 1069, in get_config_options
    _update_config_with_toml(file_contents, filename)
  File "F:\AIenv\lib\site-packages\streamlit\config.py", line 946, in _update_config_with_toml
    parsed_config_file = toml.loads(raw_toml)
  File "F:\AIenv\lib\site-packages\toml\decoder.py", line 262, in loads
    original, i)
toml.decoder.TomlDecodeError: Found invalid character in key name: '#'. Try quoting the key name. (line 1 column 3 char 2)
ns\ms-python.python-2020.9.114305\pythonFiles\lib\python\debugpy\launcher' '58862' '--' '-m' 'streamlit' 'run' 'f:\AIenv\streamlit\app2.py' '--server.port' '5678'
Traceback (most recent call last):
  File "c:\users\lt gm\appdata\local\programs\python\python37\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\lt gm\appdata\local\programs\python\python37\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "F:\AIenv\lib\site-packages\streamlit\__main__.py", line 23, in <module>
    main()
  File "F:\AIenv\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "F:\AIenv\lib\site-packages\click\core.py", line 782, in main   
    rv = self.invoke(ctx)
  File "F:\AIenv\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    return ctx.invoke(self.callback, **ctx.params)
  File "F:\AIenv\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "F:\AIenv\lib\site-packages\streamlit\cli.py", line 161, in main_run
    bootstrap.load_config_options(flag_options=kwargs)
  File "F:\AIenv\lib\site-packages\streamlit\bootstrap.py", line 318, in load_config_options
    config.get_config_options(force_reparse=True, options_from_flags=options_from_flags)
  File "F:\AIenv\lib\site-packages\streamlit\config.py", line 1069, in get_config_options
    _update_config_with_toml(file_contents, filename)
  File "F:\AIenv\lib\site-packages\streamlit\config.py", line 946, in _update_config_with_toml
    parsed_config_file = toml.loads(raw_toml)
  File "F:\AIenv\lib\site-packages\toml\decoder.py", line 262, in loads
    original, i)
toml.decoder.TomlDecodeError: Found invalid character in key name: '#'. Try quoting the key name. (line 1 column 3 char 2)

and I cannot run the app unless i delete the config.toml file

so it looks that i am doing something wrong or this solution is not working

To: @leb_dev

It looks like it can’t parse the config.toml file.
Can you post the contents of the file? I’ll be happy to help you resolve it!

P.S. Or you can open an issue on GitHub if you like.

this is the content of the file without adding the line that you suggested before.

thank you for your time.

# Below are all the sections and options you can have in ~/.streamlit/config.toml.

[global]

# By default, Streamlit checks if the Python watchdog module is available and, if not, prints a warning asking for you to install it. The watchdog module is not required, but highly recommended. It improves Streamlit's ability to detect changes to files in your filesystem.
# If you'd like to turn off this warning, set this to True.
# Default: false
disableWatchdogWarning = false

# If True, will show a warning when you run a Streamlit-enabled script via "python my_script.py".
# Default: true
showWarningOnDirectExecution = true


[logger]

# Level of logging: 'error', 'warning', 'info', or 'debug'.
# Default: 'info'
level = "info"

# String format for logging messages. If logger.datetimeFormat is set, logger messages will default to `%(asctime)s.%(msecs)03d %(message)s`. See [Python's documentation](https://docs.python.org/2.6/library/logging.html#formatter-objects) for available attributes.
# Default: None
messageFormat = "%(asctime)s %(message)s"


[client]

# Whether to enable st.cache.
# Default: true
caching = true

# If false, makes your Streamlit script not draw to a Streamlit app.
# Default: true
displayEnabled = true

# Controls whether uncaught app exceptions are displayed in the browser. By default, this is set to True and Streamlit displays app exceptions and associated tracebacks in the browser.
# If set to False, an exception will result in a generic message being shown in the browser, and exceptions and tracebacks will be printed to the console only.
# Default: true
showErrorDetails = true


[runner]

# Allows you to type a variable or string by itself in a single line of Python code to write it to the app.
# Default: true
magicEnabled = true

# Install a Python tracer to allow you to stop or pause your script at any point and introspect it. As a side-effect, this slows down your script's execution.
# Default: false
installTracer = false

# Sets the MPLBACKEND environment variable to Agg inside Streamlit to prevent Python crashing.
# Default: true
fixMatplotlib = true

# Run the Python Garbage Collector after each script execution. This can help avoid excess memory use in Streamlit apps, but could introduce delay in rerunning the app script for high-memory-use applications.
# Default: true
postScriptGC = true


[server]

# List of folders that should not be watched for changes. This impacts both "Run on Save" and @st.cache.
# Relative paths will be taken as relative to the current working directory.
# Example: ['/home/user1/env', 'relative/path/to/folder']
# Default: []
folderWatchBlacklist = []

# Change the type of file watcher used by Streamlit, or turn it off completely.
# Allowed values: * "auto" : Streamlit will attempt to use the watchdog module, and falls back to polling if watchdog is not available. * "watchdog" : Force Streamlit to use the watchdog module. * "poll" : Force Streamlit to always use polling. * "none" : Streamlit will not watch files.
# Default: "auto"
fileWatcherType = "auto"

# Symmetric key used to produce signed cookies. If deploying on multiple replicas, this should be set to the same value across all replicas to ensure they all share the same secret.
# Default: randomly generated secret key.
cookieSecret = "c79e251310888b7b7e1ed34d0e3cc2c636ca779eff64b4effac90f27e329d7af"

# If false, will attempt to open a browser window on start.
# Default: false unless (1) we are on a Linux box where DISPLAY is unset, or (2) server.liveSave is set.
headless = false

# Automatically rerun script when the file is modified on disk.
# Default: false
runOnSave = false

# The address where the server will listen for client and browser connections. Use this if you want to bind the server to a specific address. If set, the server will only be accessible from this address, and not from any aliases (like localhost).
# Default: (unset)
#address =

# The port where the server will listen for browser connections.
# Default: 8501
port = 8501

# The base path for the URL where Streamlit should be served from.
# Default: ""
baseUrlPath = ""

# Enables support for Cross-Origin Request Sharing (CORS) protection, for added security.
# Due to conflicts between CORS and XSRF, if `server.enableXsrfProtection` is on and `server.enableCORS` is off at the same time, we will prioritize `server.enableXsrfProtection`.
# Default: true
enableCORS = true

# Enables support for Cross-Site Request Forgery (XSRF) protection, for added security.
# Due to conflicts between CORS and XSRF, if `server.enableXsrfProtection` is on and `server.enableCORS` is off at the same time, we will prioritize `server.enableXsrfProtection`.
# Default: true
enableXsrfProtection = true

# Max size, in megabytes, for files uploaded with the file_uploader.
# Default: 200
maxUploadSize = 200

# Enables support for websocket compression.
# Default: true
enableWebsocketCompression = true


[browser]

# Internet address where users should point their browsers in order to connect to the app. Can be IP address or DNS name and path.
# This is used to: - Set the correct URL for CORS and XSRF protection purposes. - Show the URL on the terminal - Open the browser - Tell the browser where to connect to the server when in liveSave mode.
# Default: 'localhost'
serverAddress = "localhost"

# Whether to send usage statistics to Streamlit.
# Default: true
gatherUsageStats = true

# Port where users should point their browsers in order to connect to the app.
# This is used to: - Set the correct URL for CORS and XSRF protection purposes. - Show the URL on the terminal - Open the browser - Tell the browser where to connect to the server when in liveSave mode.
# Default: whatever value is set in server.port.
serverPort = 8501


[mapbox]

# Configure Streamlit to use a custom Mapbox token for elements like st.pydeck_chart and st.map. To get a token for yourself, create an account at https://mapbox.com. It's free (for moderate usage levels)!
# Default: ""
token = ""


[deprecation]

# Set to false to disable the deprecation warning for the file uploader encoding.
# Default: true
showfileUploaderEncoding = true

# Set to false to disable the deprecation warning for using the global pyplot instance.
# Default: true
showPyplotGlobalUse = true


[s3]

# Name of the AWS S3 bucket to save apps.
# Default: (unset)
#bucket =

# URL root for external view of Streamlit apps.
# Default: (unset)
#url =

# Access key to write to the S3 bucket.
# Leave unset if you want to use an AWS profile.
# Default: (unset)
#accessKeyId =

# Secret access key to write to the S3 bucket.
# Leave unset if you want to use an AWS profile.
# Default: (unset)
#secretAccessKey =

# The "subdirectory" within the S3 bucket where to save apps.
# S3 calls paths "keys" which is why the keyPrefix is like a subdirectory. Use "" to mean the root directory.
# Default: ""
keyPrefix = ""

# AWS region where the bucket is located, e.g. "us-west-2".
# Default: (unset)
#region =

# AWS credentials profile to use.
# Leave unset to use your default profile.
# Default: (unset)
#profile =


[theme]

# The preset Streamlit theme that your custom theme inherits from. One of "light" or "dark".
#base =

# Primary accent color for interactive elements.
#primaryColor =

# Background color for the main content area.
#backgroundColor =

# Background color used for the sidebar and most interactive widgets.
#secondaryBackgroundColor =

# Color used for almost all text.
#textColor =

# Font family for all text in the app, except code blocks. One of "sans serif", "serif", or "monospace".
#font =

I don’t get any errors when I use that TOML file. Can you please post the version of the config.toml that produces the error?

Thank you!

I did not understand what you mean by the version of config.toml.

Each time i try to create the file by typing this statement streamlit config show > ~/.streamlit/config.toml than try to run the app the system crash and display the error that i showed above.
Based on this post everyone has delete the config file and everything work again.

How to fix this because i am stuck in the old version of streamlit. v 0.84

I see. There might be an issue with Windows. Let’s get your app running first, and then we’ll fix the issue with the configuration file.

Try running your script with

streamlit run app.py --global.dataFrameSerialization="legacy"
1 Like

I tried you suggestion but the system crash and display the below error:

(AIenv) PS F:\AIenv\streamlit> streamlit run app2.py --global.dataFrameSerialization="legacy"
Usage: streamlit run [OPTIONS] TARGET [ARGS]...
Try 'streamlit run --help' for help.

Error: no such option: --global.dataFrameSerialization

What version of streamlit are you using? That config option is only available after 0.85. Try upgrading to the latest version and rerunning the command.

i did upgrade to the latest version and rerun the command it works

but when i added the line to the config.toml file it crash and display the below error:

Traceback (most recent call last):
  File "c:\users\lt gm\appdata\local\programs\python\python37\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\lt gm\appdata\local\programs\python\python37\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "F:\AIenv\lib\site-packages\streamlit\__main__.py", line 23, in <module>
    main()
  File "F:\AIenv\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "F:\AIenv\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "F:\AIenv\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "F:\AIenv\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "F:\AIenv\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "F:\AIenv\lib\site-packages\streamlit\cli.py", line 160, in main_run
    bootstrap.load_config_options(flag_options=kwargs)
  File "F:\AIenv\lib\site-packages\streamlit\bootstrap.py", line 318, in load_config_options
    config.get_config_options(force_reparse=True, options_from_flags=options_from_flags)
  File "F:\AIenv\lib\site-packages\streamlit\config.py", line 1087, in get_config_options
    file_contents = input.read()
  File "F:\AIenv\lib\codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

Hello.
I read the whole thread. The issue is still persistent even now. I am using the latest version of streamlit as of writing this reply. What can I do?

1 Like

I still have the same issue
streamlit==1.0
pyarrow==8.0.0

anaconda3/lib/python3.7/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pydict()

/anaconda3/lib/python3.7/site-packages/pyarrow/table.pxi in pyarrow.lib._from_pydict()

/anaconda3/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.asarray()

/anaconda3/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.array()

/anaconda3/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array()

/anaconda3/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status()

/anaconda3/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status()

ArrowInvalid: Could not convert 'good' with type str: tried to convert to double```

All you have to do is to put the following line before printing out
df = df.astype(str)
st.dataframe(df)
good luck

1 Like

Thanks, this worked for me!!!

(post deleted by author)

Hi @thiago , I added [global]
dataFrameSerialization = “legacy” to config.toml file and issue was resolved for local
but while hosting the app from GitHub on share.streamlit.io the issue is still persistent. Not able to read the config file or is there a way around for while hosting the app. I’m using the same code that runs well on local.

@Deepansh_Soni we have implemented a few fixes on the problem with the arrow serialization which will be released with the upcoming version (1.14). I assume this will resolve your problem with arrow, so you don’t have to use legacy serialization anymore.