Skip to content

two small issues with the docker instructions #190

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

Open
abate opened this issue Jun 8, 2025 · 3 comments
Open

two small issues with the docker instructions #190

abate opened this issue Jun 8, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@abate
Copy link

abate commented Jun 8, 2025

Hello devs :)

I encountered two minor problem in the Dockerfile instruction provided :

  • the first is easily fix: docker build -t alwrity -f "Getting Started/Option_3_Docker_Install/Dockerfile" . the path of the docker file changed

The second here, I was not able to solve it. I tried to change the base image ( upgrade to 3.12-slim ) and change the requirements.txt file, but I didn't manage.

Not sure what is wrong. There must be some requirements that keep pulling in the wrong version of panda-ta

ImportError: cannot import name 'NaN' from 'numpy' (/usr/local/lib/python3.12/site-packages/numpy/__init__.py)
Traceback:

File "/app/alwrity.py", line 81, in <module>
    from lib.utils.ui_setup import setup_ui, setup_alwrity_ui
File "/app/lib/utils/ui_setup.py", line 10, in <module>
    from lib.utils.alwrity_utils import ai_social_writer
File "/app/lib/utils/alwrity_utils.py", line 11, in <module>
    from lib.ai_writers.ai_finance_report_generator.ai_financial_dashboard import get_dashboard
File "/app/lib/ai_writers/ai_finance_report_generator/ai_financial_dashboard.py", line 22, in <module>
    from ...ai_web_researcher.finance_data_researcher import get_finance_data, get_fin_options_data
File "/app/lib/ai_web_researcher/finance_data_researcher.py", line 4, in <module>
    import pandas_ta as ta
File "/usr/local/lib/python3.12/site-packages/pandas_ta/__init__.py", line 116, in <module>
    from pandas_ta.core import *
File "/usr/local/lib/python3.12/site-packages/pandas_ta/core.py", line 18, in <module>
    from pandas_ta.momentum import *
File "/usr/local/lib/python3.12/site-packages/pandas_ta/momentum/__init__.py", line 34, in <module>
    from .squeeze_pro import squeeze_pro
File "/usr/local/lib/python3.12/site-packages/pandas_ta/momentum/squeeze_pro.py", line 2, in <module>
    from numpy import NaN as npNaN

It would also be great if you can also release the app as a docker image on dockerhub or similar services, and maybe
provide a ready to use docker-compose file for a quick local installation and testing.

regards

@uniqueumesh
Copy link
Collaborator

Hello @abate please give us some time to look into this issue. We will update you ASAP.

Regards

@uniqueumesh uniqueumesh added the bug Something isn't working label Jun 10, 2025
@AJaySi
Copy link
Owner

AJaySi commented Jun 10, 2025

@abate @uniqueumesh
I am looking into it and will update and fix it by tomorrow.
Not easily reproducible at my end, but I can acknowledge the bug as relevant.

@AJaySi
Copy link
Owner

AJaySi commented Jun 10, 2025

  1. [requirements.txt] specifies:pandas-ta>=0.3.14b0
  2. [numpy>=1.24.0]
  3. The Dockerfile uses Python 3.12 for build, but Python 3.11-slim for runtime (this can cause subtle issues).
  4. The error is due to an incompatibility between recent numpy versions (1.24+) and older pandas-ta versions, which try to import NaN from numpy (removed in numpy 1.24).

Solution:

Pin pandas-ta to a version compatible with numpy 1.24+ (e.g., pandas-ta>=0.3.14b0,!=0.3.14b0,>=0.3.15), or downgrade numpy to <1.24.
Also, use the same Python version in both build and runtime stages in Dockerfile.


requirements.txt: pandas-ta is now pinned to >=0.3.15 for compatibility with numpy >=1.24.0.
Dockerfile: Both build and runtime stages now use Python 3.12 for consistency.
docker-compose.yml: Added for easy local installation and testing. You can now run the app with:

cd "Getting Started/Option_3_Docker_Install"
docker-compose up --build

For Docker Hub release, you can build and push the image with:

docker build -t yourdockerhubusername/alwrity:latest -f "Getting Started/Option_3_Docker_Install/Dockerfile" .
docker push yourdockerhubusername/alwrity:latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants