If you’re building a data app using Streamlit inside a Jupyter Notebook environment and run into mysterious errors or warnings—you’re not alone. Here’s a quick guide on two common issues and how to fix them.
Error: Streamlit requires raw Python (.py) files, not .ipynb.
~ % streamlit --version Streamlit, version 1.46.1 (forensic-nlp) xxx@xxx ~ % streamlit run forensic_nlp_app5_certo.ipynb Usage: streamlit run [OPTIONS] TARGET [ARGS]... Try 'streamlit run --help' for help. Error: Streamlit requires raw Python (.py) files, not .ipynb. For more information, please see https://docs.streamlit.io
Fix: Convert .ipynb to .py. by running the following in your terminal to convert your notebook to a proper Python script:
~ % jupyter nbconvert --to script forensic_nlp_app5_certo.ipynb
This will create a file like:
~ % forensic_nlp_app5_certo.py
Once the .py script is ready and you launch it with:
~ % streamlit run forensic_nlp_app5_certo.py
Streamlit will start serving your app and provide both a local URL (e.g., http://localhost:8502) and a network URL for remote access. If you see a message suggesting you install Watchdog for better performance, it’s optional—but recommended for automatic file watching during development. The app will also begin loading any required models, like SentenceTransformer, and you may see logs indicating which device (e.g., mps on macOS) is being used.
However, if your script includes Oracle DB operations, as in this case, be aware of potential database errors. For example, if your script tries to create a table that already exists, you’ll encounter an error like:
~ % DatabaseError: ORA-00955: name is already used by an existing object
This means the table forensic_vectors already exists in your Oracle DB. You can handle this gracefully by wrapping your SQL in BEGIN ... EXCEPTION ... END; blocks or adding checks before table creation.
Despite the error, the rest of the Streamlit app may continue processing, as shown by the successful completion of vector batches. Just be sure to monitor your logs and handle such database exceptions to ensure a smoother app experience.
% streamlit run forensic_nlp_app5_certo.py
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8502
Network URL: http://<your-local-ip>:8502
For better performance, install the Watchdog module:
$ xcode-select --install
$ pip install watchdog
INFO:sentence_transformers.SentenceTransformer:Use pytorch device_name: mps
INFO:sentence_transformers.SentenceTransformer:Load pretrained SentenceTransformer: all-MiniLM-L6-v2
INFO:sentence_transformers.SentenceTransformer:Use pytorch device_name: mps
INFO:sentence_transformers.SentenceTransformer:Load pretrained SentenceTransformer: all-MiniLM-L6-v2
INFO:sentence_transformers.SentenceTransformer:Use pytorch device_name: mps
INFO:sentence_transformers.SentenceTransformer:Load pretrained SentenceTransformer: all-MiniLM-L6-v2
INFO:sentence_transformers.SentenceTransformer:Use pytorch device_name: mps
INFO:sentence_transformers.SentenceTransformer:Load pretrained SentenceTransformer: all-MiniLM-L6-v2
Batches: 0%| | 0/1 [00:00<?, ?it/s]────────────────────────── Traceback (most recent call last) ───────────────────────────
/Users/x/anaconda3/envs/forensic-nlp/lib/python3.11/site-packages/streamlit/r
untime/scriptrunner/exec_code.py:128 in exec_func_with_error_handling
/Users/x/anaconda3/envs/forensic-nlp/lib/python3.11/site-packages/streamlit/r
untime/scriptrunner/script_runner.py:669 in code_to_exec
/Users/xs/Downloads/forensic_nlp_app5_certo.py:42 in <module>
<pre><code> 39 conn = oracledb.connect(user="****", password="***************", dsn="localhost:15
40 cur = conn.cursor()
41 cur.execute("BEGIN EXECUTE IMMEDIATE 'DROP TABLE forensic_vectors'; EXCEPTION </code></pre>
❱ 42 cur.execute("""
43 CREATE TABLE forensic_vectors (
44 │ id NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
45 │ filename VARCHAR2(255),
/Users/x/anaconda3/envs/forensic-nlp/lib/python3.11/site-packages/oracledb/cu
rsor.py:708 in execute
<pre><code> 705 │ │ """
706 │ │ self._prepare_for_execute(statement, parameters, keyword_parameters)
707 │ │ impl = self._impl </code></pre>
❱ 708 │ │ impl.execute(self)
709 │ │ if impl.fetch_vars is not None:
710 │ │ │ return self
711
in oracledb.thin_impl.ThinCursorImpl.execute:277
in oracledb.thin_impl.Protocol._process_single_message:482
in oracledb.thin_impl.Protocol._process_single_message:483
in oracledb.thin_impl.Protocol._process_message:475
in oracledb.thin_impl.Message._check_and_raise_exception:102
────────────────────────────────────────────────────────────────────────────────────────
DatabaseError: ORA-00955: name is already used by an existing object
Help: https://docs.oracle.com/error-help/db/ora-00955/
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 2.95it/s]
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.49it/s]
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 14.58it/s]
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 30.45it/s]
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 43.23it/s]
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 69.85it/s]
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 19.31it/s]
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 47.36it/s]
After resolving the .ipynb compatibility issue and handling the Oracle database error, the Streamlit app launched successfully from the terminal. The interface loaded in the browser as expected, displaying the Oracle Cyber Forensic Analyzer—an intuitive tool that allows users to upload documents (PDF, DOCX, TXT, CSV, JSON) for forensic analysis using Oracle LLM.
As seen in the screenshot below, the app provides a drag-and-drop file uploader, displays uploaded files with metadata (like size), and offers additional fields for Oracle Cloud integration. Everything worked smoothly after converting the script and running it correctly:



*The views expressed here are my own and do not represent those of my employer.*
Hello, I’m Bruno — a dual citizen of Brazil and Sweden. I bring a global perspective shaped by experiences in both South America and Europe, with a strong focus on collaboration and innovation across cultures. I am a Computer Scientist, PhD Candidate in Information and Communication Technologies, focusing on Data Science and Artificial Intelligence, and hold dual Master’s degrees in Data Science and Cybersecurity. With over fifteen years of international experience spanning Brazil, Hungary, and Sweden, I have collaborated with global organizations such as IBM, Playtech, and Oracle, as well as contributed remotely to projects across multiple regions. My professional interests include Databases, Cybersecurity, Cloud Computing, Data Science, Data Engineering, Big Data, Artificial Intelligence, Programming, and Software Engineering, all driven by a deep passion for transforming data into strategic business value.