If you encounter ipykernel errors when running Jupyter notebooks, follow these steps to register your Conda environment as a Jupyter kernel.
conda activate [YOUR_ENV_NAME]
# Example
conda activate baseconda install ipykernel ipython numpy pandas pyarrowpython -m ipykernel install --user --name=[YOUR_ENV_NAME] --display-name "[DISPLAY_NAME]"
# Example
python -m ipykernel install --user --name=base --display-name "Python (base)"Note: Replace [YOUR_ENV_NAME] with your actual environment name and [DISPLAY_NAME] with how you want it to appear in Jupyter.
After completing these steps, restart Jupyter and select your kernel from the kernel dropdown menu.
Some code requires specific Python versions. If you get compatibility errors, check your Python version and create a new Conda environment with the required version.
conda create -n [YOUR_ENV_NAME] python=[PYTHON_VERSION] [YOUR_PACKAGES] -y
# Example: Create environment with Python 3.11
conda create -n data-science python=3.11 pandas numpy pyarrow jupyter -yconda activate [YOUR_ENV_NAME]
# Example
conda activate data-science- In VS Code: Press
Cmd+Shift+P→ "Python: Select Kernel" → Choose your new environment - In Jupyter: Click the kernel selector in the top right → Choose your new environment
After switching kernels, run your code again to verify compatibility.
When saving a DataFrame to Parquet, you may get an error like:
ArrowKeyError: A type extension with name pandas.period already defined
or
ArrowKeyError: No type extension with name arrow.py_extension_type found
Your DataFrame contains pandas extension types (like StringDtype, PeriodDtype) that PyArrow cannot serialize properly. This often happens when:
- You read CSV with
dtype={"column": "string"}(creates StringDtype) - You perform operations like joins or groupby that create new extension types
- Your Python version and pandas/pyarrow versions are incompatible
conda activate [YOUR_ENV_NAME]
pip install --upgrade pyarrowconda activate [YOUR_ENV_NAME]
pip install pandas==2.2.0 pyarrow==14.0.0If you're using Python 3.14.x, switch to Python 3.11:
# Create new environment with Python 3.11
conda create -n data-science python=3.11 pandas numpy pyarrow jupyter -y
conda activate data-scienceThen select this kernel in VS Code or Jupyter.
Convert all pandas extension types to regular NumPy types:
# Convert string columns to object type
final_clean = final.copy()
for col in final_clean.columns:
if str(final_clean[col].dtype) == "string":
final_clean[col] = final_clean[col].astype("object")
final_clean.to_parquet(OUT / "sales_processed.parquet", index=False)Try Option 1 first. If the error persists, use Option 3 (Python 3.11).