I cannot install pandas 1.2.5
-
I'm using kaggle to test my strategies on the cloud.
Today an error occurs:
KeyError: "cannot represent labeled-based slice indexer for coordinate 'time' with a slice over integer positions; the index is unsorted or non-unique"
Then I check the installation of the packages. I found that pandas 1.2.5 was not successfully installed, which cause the error.
The error results from the wrong version of pandas, but I cannot install pandas 1.2.5, so I cannot fix the error.
Does anyone know how to install pandas 1.2.5 on kaggle?
I may need some help from @support
Thx very much -
This post is deleted! -
@omohyoid Hi, you can switch to google colab
-
@omohyoid Hi,
We recently upgraded our library to use Python v3.10, but it still requires Pandas v1.2.5 to function properly. To avoid dependency issues, we recommend using Conda to create an environment and then installing Pandas v1.2.5 with
pip
. Here’s the approach:- Use Conda to set up the environment.
- As the final step, install Pandas 1.2.5 using the command
pip install 'pandas==1.2.5'
.
This method installs everything without errors and ensures compatibility. Until we update the
qnt
library to support a newer version of Pandas, you can use this strategy to set up your environment.If you encounter any issues or have further questions, feel free to reach out.
-
@support
Do you mean I need to run the commands like this? -
@illustrious-felice Thanks for ur suggestion, I'll try it
-
@illustrious-felice It still fails to install pandas 1.2.5 in GCP
-
@omohyoid Apparently it can't find dependencies to build Pandas. In a clean container you may not have gcc and g++ packages installed.
Try to do
apt-get install --yes gcc g++
before installing Pandas. -
@omohyoid I did some tests and yes, there is a problem. Unfortunately, updating pandas is not as trivial task as one could think and we are working on it. For now, the problem can be solved by downgrading cython package before trying to install pandas. Here is how to do it properly:
!apt-get update && apt-get install -y gcc g++ !pip install --no-cache-dir 'cython==0.29.37' !pip install --no-cache-dir --no-build-isolation 'pandas==1.2.5'
-
@support Thx for ur reply
I'll try it