Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Colab, numpy dependencies... #329

Closed
twopirllc opened this issue Jul 6, 2021 · 9 comments
Closed

Google Colab, numpy dependencies... #329

twopirllc opened this issue Jul 6, 2021 · 9 comments
Labels
help wanted Extra attention is needed info Informational question Further information is requested

Comments

@twopirllc
Copy link
Owner

twopirllc commented Jul 6, 2021

This issue still persists on google colab, due to dependencies...

ERROR: tensorflow 2.5.0 has requirement numpy~=1.19.2, but you'll have numpy 1.21.0 which is incompatible.
ERROR: tensorflow 2.5.0 has requirement six~=1.15.0, but you'll have six 1.16.0 which is incompatible.
ERROR: google-colab 1.0.0 has requirement pandas~=1.1.0; python_version >= "3.0", but you'll have pandas 1.3.0 which is incompatible.
ERROR: google-colab 1.0.0 has requirement six~=1.15.0, but you'll have six 1.16.0 which is incompatible.
ERROR: datascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible.
ERROR: albumentations 0.1.12 has requirement imgaug<0.2.7,>=0.2.5, but you'll have imgaug 0.2.9 which is incompatible.
Proceed (y/n)? y
ERROR: tensorflow 2.5.0 has requirement numpy~=1.19.2, but you'll have numpy 1.21.0 which is incompatible.
ERROR: tensorflow 2.5.0 has requirement six~=1.15.0, but you'll have six 1.16.0 which is incompatible.
ERROR: google-colab 1.0.0 has requirement pandas~=1.1.0; python_version >= "3.0", but you'll have pandas 1.3.0 which is incompatible.
ERROR: google-colab 1.0.0 has requirement six~=1.15.0, but you'll have six 1.16.0 which is incompatible.
ERROR: datascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible.
ERROR: albumentations 0.1.12 has requirement imgaug<0.2.7,>=0.2.5, but you'll have imgaug 0.2.9 which is incompatible.

Originally posted by @gate27keeper in #324 (comment)

@twopirllc twopirllc added help wanted Extra attention is needed info Informational question Further information is requested labels Jul 6, 2021
@UlasTosun
Copy link

Hello,
I have faced with the same problem. I don't know the reason, so I can't help you @twopirllc . However, for those who have faced with this problem on Colab and want to overcome this quickly, I have a suggestion. Using previous version overcomes this problem. Just specify the version while installing Pandas TA. For me, the version below solves the problem:
! pip install pandas_ta==0.2.45b
By the way, Pandas TA is one of the best technical libraries, you did a great job @twopirllc . Thank you for all.

@twopirllc
Copy link
Owner Author

Hello @UlasTosun,

Thanks for chiming in and helping!

Using previous version overcomes this problem. Just specify the version while installing Pandas TA.

I believe this is the appropriate course of action at this time until your other requirements (tensorflow, google-colab, et al) are no longer hindered by their own dependencies.

Do you know if you are able to edit the local copy on your Google Colab version? Or do a manual install of sorts? If so, there could be a way until I can find a work around; but there are no promises.

By the way, Pandas TA is one of the best technical libraries, you did a great job @twopirllc

Thank you!
KJ

@UlasTosun
Copy link

Hi @twopirllc ,

Do you know if you are able to edit the local copy on your Google Colab version? Or do a manual install of sorts? If so, there could be a way until I can find a work around; but there are no promises.

I am not sure about that I understood your question properly. However, here is my answer:
Colab provides 2 ways for running Python scripts.
First way is using local runtime. If you do this, Colab uses your computer and of course your local libraries which are installed on your computer. Simply, it acts like Jupyter Notebook. So you can install any version you want.
Second and most common way is using Colab as a cloud computer mechanism. In this way, some common libraries such as Numpy are preinstalled. Since Pandas-TA is not preinstalled, you should install it manually every time when you are connected to Colab.
So, I am specifying the version while installing it every time.

I believe this is the appropriate course of action at this time until your other requirements (tensorflow, google-colab, et al) are no longer hindered by their own dependencies.

First of all, as an additional information, you can force Colab to install specific versions even for preinstalled libraries.
On the other hand, I am using default (preinstalled) versions of TensorFlow, XGBoost, Numpy, Pandas, etc. and they all works properly with Pandas-TA v0.2.45b.
Since Google regularly updates preinstalled versions of common libraries, let me share the current preinstalled versions of some common and related libraries. They all works properly and compatible with Pandas-TA v0.2.45b.
Pandas v1.1.5
Numpy v1.19.5
Sklearn v0.22.2.post1
XGBoost v0.90
TensorFlow v2.5.0
I hope it helps Colab users.
Sincerely....

@twopirllc
Copy link
Owner Author

@UlasTosun,

Colab provides 2 ways for running Python scripts.

I did not know this. Thanks for letting me know.

First way is using local runtime. If you do this, Colab uses your computer and of course your local libraries which are installed on your computer. Simply, it acts like Jupyter Notebook. So you can install any version you want.

If one is using this case, then they can do some minor modifications one can do to use the latest version and not encounter these dependency issues.

Second and most common way is using Colab as a cloud computer mechanism. In this way, some common libraries such as Numpy are preinstalled. Since Pandas-TA is not preinstalled, you should install it manually every time when you are connected to Colab.

If one is using this case, then it will take me longer to come up with a solution. I do not use Colab (Cloud nor local).

First of all, as an additional information, you can force Colab to install specific versions even for preinstalled libraries.

Do you know if Colab has issues with @gate27keeper 's dependency versions (excluding Pandas TA)?

On the other hand, I am using default (preinstalled) versions of TensorFlow, XGBoost, Numpy, Pandas, etc. and they all works properly with Pandas-TA v0.2.45b.

Good to know.

Since Google regularly updates preinstalled versions of common libraries, let me share the current preinstalled versions of some common and related libraries. They all works properly and compatible with Pandas-TA v0.2.45b.
Pandas v1.1.5
Numpy v1.19.5
Sklearn v0.22.2.post1
XGBoost v0.90
TensorFlow v2.5.0
I hope it helps Colab users.

Thank you!
KJ

@UlasTosun
Copy link

@twopirllc
I have check the dependencies here is the final results for Colab users:

Numpy v1.19.5 is the preinstalled version on Colab for now (they may change it later). However, Pandas-TA v0.3.02b uses "sliding_window_view" which was added to Numpy in v1.20.0. So, Colab users have two options to import Pandas-TA properly:

  1. If you want to keep using preinstalled Numpy (v1.19.5), then install any Pandas-TA version <= v0.2.45b by using this command:
    ! pip install pandas_ta==0.2.45b
  2. If you want to use the latest version of Pandas-TA then install Numpy version => 1.20.0 by using this command:
    ! pip install numpy==1.20.0
    In this case, you are going to force Colab to install a newer version over a preinstalled version. You should restart your runtime to use new version (Colab is going to warn you about this). However, be careful about your other dependencies.

I have tried the following libraries together on Colab and it seems that they all work together properly:
Pandas-TA v0.3.02b
Numpy v1.21.0
Pandas v1.1.5
Sklearn v0.22.2.post1
XGBoost v0.90
TensorFlow v2.5.0

I think, the second option is better, it offers latest versions of both Pandas-TA and Numpy. Just keep reinstalling newer versions of Numpy (=> 1.20.0) until Google updates preinstalled Numpy version on Colab.

@twopirllc in my opinion, you should change or fix nothing on Pandas-TA. Reinstalling a newer version of Numpy solves this issue. Believe me, Google will update the preinstalled version of Numpy in a couple of months. They always keep updating preinstalled versions. For example, the preinstalled version of TensorFlow was 1.xx in a couple of months ago and now it is 2.5.0.

Thank you!

@twopirllc
Copy link
Owner Author

@UlasTosun,

Thanks for sharing this information! It is very useful. 😎 I agree with your opinion and I am sure that the Colab package dependencies will be taken care of soon enough despite the current inconvenience.

Thanks,
KJ

twopirllc added a commit that referenced this issue Jul 25, 2021
@twopirllc
Copy link
Owner Author

Hello @UlasTosun,

I have an updated version on the development branch that should address the numpy version problem. I would appreciate your feed back on this when you get a chance before I update the main branch.

$ pip install -U git+https://github.com/twopirllc/pandas-ta.git@development

Thanks,
KJ

@UlasTosun
Copy link

Dear @twopirllc ,
I have checked it and I have good news. At the moment, preinstalled Numpy version on Colab is 1.19.5 and it works properly with the Pandas-TA version on the development branch. There is no error while importing. So, I think you can update the main branch.
Thank you for solving this issue!

@twopirllc
Copy link
Owner Author

@UlasTosun,

Indeed this is good news! I appreciate you taking the time to help resolve this Issue, testing also, and your patience for me to patch it.

Hopefully soon a couple of others can confirm from Issue #285 that it also works for them so I can update the main branch.

Thanks,
KJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed info Informational question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants