hyosubkim / bayes-toolbox

bayes-toolbox
https://hyosubkim.github.io/bayes-toolbox/
Other
92 stars 5 forks source link

Cannot Install bayes-toolbox #19

Open DLWCMD opened 9 months ago

DLWCMD commented 9 months ago

I have tried a number of different ways to install your package in a virtual environment, both conda and poetry, but all have failed.

I have set the requirements to meet those associated with your latest version, 0.1.3. When I try to install with pip, I am advised, for example, that there is no version available, so it can't meet confirm requirements for any of your versions. Cloning the latest development version results in the same problem.

I am running on a macAIr M2, 16GB, macOS Sonoma 14.1.2

Thanks.

David Wilt

P. S. I am interested in contributing to your project and will add another issue for that purpose.

hyosubkim commented 9 months ago

Hi David - Thanks for pointing this out to me, and sorry for the inconvenience. Is there any chance you are using Python 3.12? I noticed that when I tried to install it on 3.12, it failed. However, if I create a new environment with Python 3.11, I can verify that it installs fine on a similar OS as you.

For the time being, you may want to try that as well. In the meantime, I will look into finding a more robust solution.

Thanks for your patience. Let me know how it goes, and looking forward to your future contributions!

DLWCMD commented 9 months ago

Thanks for your quick response, and I was able to load successfully by creating a new conda venv and stipulating python=3.11.5

However, now I cannot run any of your examples, apparently because there is no available kernel. I tried to follow your instructions, but apparently the kernel.json file cannot be found.

Any thoughts?

Thanks again.

P. S. I enjoyed your Youtube presentation, which makes me eager to explore your tool.

hyosubkim commented 9 months ago

Sure thing, David. Glad you were able to successfully install now.

Wrt the kernel, did you follow the instructions under "Helpful hints" on this page: https://hyosubkim.github.io/bayes-toolbox/getting-started/ ?

You should be able to access the appropriate kernel (i.e., the one associated with the new environment containing bayes-toolbox) after doing so. I just tested the commands in a new environment and it worked for me.

Let me know if you are still running into problems. And thanks for the nice compliment about the presentation! I hope you can start getting some use out of the package soon!

DLWCMD commented 9 months ago

I really appreciate hearing from you. I will have some additional results to share with you within the next 24 hours. I have confirmed that my first environment/project was flawed because it loaded some package versions that are not consistent with your current specifications, for example numpy 1.26.2 rather than 1.23.4. Not surprisingly, none of your example notebooks executed successfully. I will create a new project to employ your designated versions.

I will say the examples provide a good overview of the types of models and analysis that are possible with your package, without the verboseness of pyMC. I would like to share my current package, mlcompare, which is designed for statistically-based comparison and selection of estimators. I see much synergy between the two packages.

Keep up the good work.

From: Hyosub Kim @.> Reply-To: hyosubkim/bayes-toolbox @.> Date: Tuesday, December 12, 2023 at 8:02 PM To: hyosubkim/bayes-toolbox @.> Cc: DLWCMD @.>, Author @.***> Subject: Re: [hyosubkim/bayes-toolbox] Cannot Install bayes-toolbox (Issue #19)

Sure thing, David. Glad you were able to successfully install now.

Wrt the kernel, did you follow the instructions under "Helpful hints" on this page: https://hyosubkim.github.io/bayes-toolbox/getting-started/ ?

You should be able to access the appropriate kernel (i.e., the one associated with the new environment containing bayes-toolbox) after doing so. I just tested the commands in a new environment and it worked for me.

Let me know if you are still running into problems. And thanks for the nice compliment about the presentation! I hope you can start getting some use out of the package soon!

— Reply to this email directly, view it on GitHubhttps://github.com/hyosubkim/bayes-toolbox/issues/19#issuecomment-1853101464, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALUME6XUHSUZBC6EKM7J3NTYJD5BNAVCNFSM6AAAAABAQBRCOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJTGEYDCNBWGQ. You are receiving this because you authored the thread.Message ID: @.***>

hyosubkim commented 8 months ago

Thanks, David! Let me know how it goes.

Also, thanks for sending me the info regarding mlcompare. It sounds interesting! Just to let you know—I won't have time to look over your pdf until likely January. My day gig is occupying most of my time these days! 😄

DLWCMD commented 8 months ago

I understand as to above. I wanted you to be aware that I have tried and failed to create a virtual as you proposed in the getting started section. I am able to clone bayes-toolbox, but and then creating an environment using environment.yml fails.

Here is the command I used: conda env create --name bayes_tb1 --file environment.yml and the results as shown below.

The problem may be related to a mal-formed poetry .toml file. Poetry install fails, and I know some of the required structures are not included, specifically the tool.poetry section. https://python-poetry.org/docs/pyproject/

I will continue to investigate. Have a good holiday.

Collecting package metadata (repodata.json): - WARNING conda.models.version:get_matcher(556): Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0., but conda is ignoring the . and treating it as 1.8.0 WARNING conda.models.version:get_matcher(556): Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0., but conda is ignoring the . and treating it as 1.9.0 done

Solving environment: failed Collecting package metadata (repodata.json): - WARNING conda.models.version:get_matcher(556): Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0., but conda is ignoring the . and treating it as 1.8.0 WARNING conda.models.version:get_matcher(556): Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0., but conda is ignoring the . and treating it as 1.9.0 done Solving environment: failed

ResolvePackageNotFound:

  • c-ares==1.18.1=h0d85af4_0
  • matplotlib-base==3.6.2=py311h2bf763f_0
  • fribidi==1.0.10=haf1e3a3_0
  • tbb==2021.6.0=hb8565cd_1
  • fonttools==4.38.0=py311h5547dcb_1
  • mkl-service==2.4.0=py311h552c0e0_0
  • cxx-compiler==1.5.1=hb8565cd_0
  • psutil==5.9.4=py311h5547dcb_0
  • libssh2==1.10.0=h47af595_3
  • numpy==1.23.4=py311h62c7003_1
  • blas-devel==3.9.0=16_osx64_openblas
  • libwebp==1.2.4=hfa4350a_0
  • pthread-stubs==0.4=hc929b4f_1001
  • xorg-libxdmcp==1.1.3=h35c211d_0
  • clangxx_osx-64==14.0.6=h6f97653_3
  • libzip==1.9.2=h6db710c_1
  • pcre2==10.40=h1c4e4bc_0
  • libcurl==7.86.0=h581aaea_1
  • python==3.11.0=h559f36b_0_cpython
  • gts==0.7.6=hccb3bdf_2
  • bzip2==1.0.8=h0d85af4_4
  • libgfortran5==11.3.0=h082f757_26
  • graphite2==1.3.14=he9d5cce_1
  • atk-1.0==2.38.0=h1d18e73_1
  • ca-certificates==2023.08.22=hecd8cb5_0
  • libglib==2.74.1=h4c723e1_1
  • sigtool==0.1.3=h88f4db0_0
  • libllvm14==14.0.6=h5b596cc_1
  • argon2-cffi-bindings==21.2.0=py311h5547dcb_3
  • llvm-openmp==15.0.4=h61d9ccf_0
  • zstd==1.5.2=hfa58983_4
  • contourpy==1.0.6=py311hd2070f0_0
  • libclang-cpp14==14.0.6=default_h55ffa42_0
  • lerc==4.0.0=hb486fe8_0
  • ld64==609=hc6ad406_10
  • zeromq==4.3.4=he49afe7_1
  • libzlib==1.2.13=hfd90126_4
  • icu==70.1=h96cf925_0
  • libbrotlidec==1.0.9=hb7f2c08_8
  • pango==1.50.11=h7fca291_0
  • packaging==23.1=py311hecd8cb5_0
  • giflib==5.2.1=hbcb3906_2
  • librsvg==2.54.4=h3d48ba6_0
  • gdk-pixbuf==2.42.8=h3648f77_1
  • brotli==1.0.9=hb7f2c08_8
  • cryptography==38.0.3=py311h61927ef_0
  • hdf4==4.2.15=h7aa5921_5
  • compiler-rt==14.0.6=h613da45_0
  • c-compiler==1.5.1=hbf74d83_0
  • clang==14.0.6=h694c41f_0
  • pyrsistent==0.19.2=py311h5547dcb_0
  • certifi==2023.7.22=py311hecd8cb5_0
  • kiwisolver==1.4.4=py311hd2070f0_1
  • llvm-tools==14.0.6=h5b596cc_1
  • pillow==9.2.0=py311he7df5c9_3
  • pandoc==2.19.2=h694c41f_1
  • patsy==0.5.3=py311hecd8cb5_0
  • jpeg==9e=hac89ed1_2
  • libcxx==14.0.6=hccf4f1f_0
  • mkl==2022.1.0=h860c996_928
  • pyzmq==24.0.1=py311habfacb3_1
  • cctools_osx-64==973.0.1=h2b95895_10
  • cffi==1.15.1=py311ha86e640_2
  • graphviz==6.0.1=ha8464fc_0
  • markupsafe==2.1.1=py311h5547dcb_2
  • libbrotlienc==1.0.9=hb7f2c08_8
  • readline==8.1.2=h3899abd_0
  • statsmodels==0.13.5=py311hd5badaa_2
  • pandas==1.5.1=py311hd84f3f5_1
  • harfbuzz==5.3.0=h08f8713_0
  • libtiff==4.4.0=hdb44e8a_4
  • libwebp-base==1.2.4=h775f41a_0
  • libgfortran==5.0.0=9_5_0_h97931a8_26
  • libtool==2.4.6=hcec6c5f_1009
  • libdeflate==1.14=hb7f2c08_0
  • libcblas==3.9.0=16_osx64_openblas
  • libnetcdf==4.8.1=nompi_hc61b76e_106
  • gtk2==2.24.33=h7c1209e_2
  • krb5==1.19.3=hb98e516_0
  • ncurses==6.3=h96cf925_1
  • debugpy==1.6.3=py311h814d153_1
  • openjpeg==2.5.0=h5d0d7b0_1
  • xorg-libxau==1.0.9=h35c211d_0
  • curl==7.86.0=h581aaea_1
  • libedit==3.1.20191231=h0678c8f_2
  • cftime==1.6.2=py311hd5badaa_1
  • libffi==3.4.2=h0d85af4_5
  • tk==8.6.12=h5dbffcc_0
  • libpng==1.6.38=ha978bb4_0
  • xz==5.2.6=h775f41a_0
  • ld64_osx-64==609=h1e06c2b_10
  • hdf5==1.12.2=nompi_h1f71328_100
  • openblas==0.3.21=openmp_hbefa662_3
  • brotli-bin==1.0.9=hb7f2c08_8
  • scipy==1.9.3=py311h939689b_2
  • aesara-base==2.8.7=py311h6eed73b_1
  • libiconv==1.17=hac89ed1_0
  • libsqlite==3.39.4=ha978bb4_0
  • libnghttp2==1.47.0=h5aae05b_1
  • tapi==1100.0.11=h9ce4665_0
  • cctools==973.0.1=h76f1dac_10
  • liblapack==3.9.0=16_osx64_openblas
  • openssl==3.0.11=hca72f7f_2
  • brotlipy==0.7.0=py311h5547dcb_1005
  • clang_osx-64==14.0.6=h3113cd8_3
  • lcms2==2.14=h90f4b2a_0
  • libblas==3.9.0=16_osx64_openblas
  • libev==4.33=haf1e3a3_1
  • clangxx==14.0.6=default_h55ffa42_0
  • aesara==2.8.7=py311h1d45e85_1
  • cairo==1.16.0=h904041c_1014
  • gettext==0.21.1=h8a4c099_0
  • libopenblas==0.3.21=openmp_h429af6e_3
  • pixman==0.40.0=h9ed2024_1
  • tornado==6.2=py311h5547dcb_1
  • zlib==1.2.13=hfd90126_4
  • clang-14==14.0.6=default_h55ffa42_0
  • libbrotlicommon==1.0.9=hb7f2c08_8
  • libxml2==2.10.3=hb9e07b5_0
  • libsodium==1.0.18=hbcb3906_1
  • liblapacke==3.9.0=16_osx64_openblas
  • jupyter_core==5.0.0=py311h6eed73b_0
  • netcdf4==1.6.1=nompi_py311h41bc3eb_101
  • libxcb==1.13=h0d85af4_1004
  • expat==2.5.0=hcec6c5f_0
  • libgd==2.3.3=he7e2580_1
  • fontconfig==2.14.1=hb0a0c50_2
  • freetype==2.12.1=h3f81eb7_0
DLWCMD commented 8 months ago

I wanted to summarize my findings to date. In short, while I can install bayes-toolbox, I cannot use it successfully, at least with virtual environments. If I install with either pip install bayes_toolbox or clone from github, all the examples fail with the following error:

AttributeError: module 'numpy.config' has no attribute 'get_info'

I know that the clone returns both an environment.yml and a requirements.txt. The first fails because of conflicts among the packages, all of which seem to have a specified version. I can pip install the requirements file, but doing so does not resolve the error reported above.

Finally, the clone includes a pyproject.toml file containing a poetry structure, but that fails due to lock of required segments, including the tool.poetry section.

I hope this information is useful, and I am happy to help resolve these issues.

David Wilt

hyosubkim commented 8 months ago

David - Sorry to hear it's still not working properly for you. Unfortunately, I was unable to recreate the issue you are reporting. I am running conda version 22.9.0 on a 2023 Macbook Pro, Ventura 13.4.1 OS.

After cloning the repo, I ran the same conda command you did to create a new virtual environment without issue. After activating the new virtual environment and making it available to JupyterLab, I also tested BEST.ipynb and logistic-regression.ipynb from the examples directory without any problems.

I also successfully ran everything by "starting fresh" and first creating a generic conda environment. Specifically, the commands I entered from my base environment were: 1) conda create --name test_bt python=3.11 2) conda activate test_bt 3) pip install bayes_toolbox 4) pip install --user ipykernel 5) python -m ipykernel install --user --name=test_bt 6) Opened JupyterLab and connected to test_bt kernel 7) Downloaded bayes-toolbox code from GitHub and tested notebooks from examples directory.

Let me know if this works for you. Thanks for the report.

DLWCMD commented 8 months ago

Thanks very much for addressing my concerns. I cannot explain the difference between your results and mine, but I duplicated the latter several times.

I will apply your steps and report back.

Just to make sure I understand your process, I have two questions:

  1. You are using Jupyter Lab, not basic Jupyter.
  2. What method did you use to download

Thanks.

From: Hyosub Kim @.> Reply-To: hyosubkim/bayes-toolbox @.> Date: Saturday, December 16, 2023 at 9:14 PM To: hyosubkim/bayes-toolbox @.> Cc: DLWCMD @.>, Author @.***> Subject: Re: [hyosubkim/bayes-toolbox] Cannot Install bayes-toolbox (Issue #19)

David - Sorry to hear it's still not working properly for you. Unfortunately, I was unable to recreate the issue you are reporting. I am running conda version 22.9.0 on a 2023 Macbook Pro, Ventura 13.4.1 OS.

After cloning the repo, I ran the same conda command you did to create a new virtual environment without issue. After activating the new virtual environment and making it available to JupyterLab, I also tested BEST.ipynb and logistic-regression.ipynb from the examples directory without any problems.

I also successfully ran everything by "starting fresh" and first creating a generic conda environment. Specifically, the commands I entered from my base environment were:

  1. conda create --name test_bt python=3.11
  2. conda activate test_bt
  3. pip install bayes_toolbox
  4. pip install --user ipykernel
  5. python -m ipykernel install --user --name=test_bt
  6. Opened JupyterLab and connected to test_bt kernel
  7. Downloaded bayes-toolbox code from GitHub and tested notebooks from examples directory.

Let me know if this works for you. Thanks for the report.

— Reply to this email directly, view it on GitHubhttps://github.com/hyosubkim/bayes-toolbox/issues/19#issuecomment-1859015916, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALUME6X5JK3255Z5CR3XH3DYJZISFAVCNFSM6AAAAABAQBRCOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGAYTKOJRGY. You are receiving this because you authored the thread.Message ID: @.***>

hyosubkim commented 8 months ago

1) Yes, I'm using JupyterLab. 2) For my second test, the one I provided the seven steps for, I downloaded bayes-toolbox directly from the GitHub page by hitting the big green "Code" button and selecting "Download Zip". I then unzipped the folder and ran everything from inside the project folder.

Hope this helps!

DLWCMD commented 8 months ago

Thanks and understand about downloading the zip code file. Since you are using Jupyter, do you then load the into a notebook or a script?

Thanks

On Sun, Dec 17, 2023, 8:56 PM Hyosub Kim @.***> wrote:

  1. Yes, I'm using JupyterLab.
  2. For my second test, the one I provided the seven steps for, I downloaded bayes-toolbox directly from the GitHub page by hitting the big green "Code" button and selecting "Download Zip". I then unzipped the folder and ran everything from inside the project folder.

Hope this helps!

— Reply to this email directly, view it on GitHub https://github.com/hyosubkim/bayes-toolbox/issues/19#issuecomment-1859421215, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALUME6UWMW5ZCE23XURPQXDYJ6PEFAVCNFSM6AAAAABAQBRCOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGQZDCMRRGU . You are receiving this because you authored the thread.Message ID: @.***>

DLWCMD commented 8 months ago

I am afraid I cannot use your package, which is disappointing. None of the solutions you have offered work for me. When I tried your step-wise approach and loaded the source code into my project, I receive the following message:

Jupyter server process exited with code 1 Error executing Jupyter command 'notebook': [Errno 2] No such file or directory

Good luck going forward.

hyosubkim commented 8 months ago

Just so I understand and to simplify things: assuming you can successfully pip install bayes-toolbox, can you try to simply import one of its modules into a JupyterLab notebook? Concretely, after connecting to a kernel with bayes-toolbox installed, what happens if you type in: import bayes_toolbox.glm as bg in a cell? Does that work?

DLWCMD commented 8 months ago

It appears to, at least insofar as importing. Here’s a screen shot. However, I could not interact with bg other than to determine its type. That is, I reviewed the glm.py code, but could not import any of its functions, so I am not sure if the import Is performing as required.

BTW, I have never had the pleasure of working such a responsive developer, and I apologize for taking so much of your time.

@.***

From: Hyosub Kim @.> Reply-To: hyosubkim/bayes-toolbox @.> Date: Monday, December 18, 2023 at 1:08 PM To: hyosubkim/bayes-toolbox @.> Cc: DLWCMD @.>, Author @.***> Subject: Re: [hyosubkim/bayes-toolbox] Cannot Install bayes-toolbox (Issue #19)

Just so I understand and to simplify things: assuming you can successfully pip install bayes-toolbox, can you try to simply import one of its modules into a JupyterLab notebook? Concretely, after connecting to a kernel with bayes-toolbox installed, what happens if you type in: import bayes_toolbox.glm as bg in a cell? Does that work?

— Reply to this email directly, view it on GitHubhttps://github.com/hyosubkim/bayes-toolbox/issues/19#issuecomment-1861225004, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALUME6UNMCXCUFKTDU4YIYDYKCBCFAVCNFSM6AAAAABAQBRCOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRRGIZDKMBQGQ. You are receiving this because you authored the thread.Message ID: @.***>

hyosubkim commented 8 months ago

No problem, David. I just want installation to be easier for folks so that they can actually use bayes-toolbox.

I looked up the NumPy error you were receiving:

AttributeError: module 'numpy.config' has no attribute 'get_info'

Not sure why this should work, but others using pymc have also ran into problems and fixed it by upgrading to numpy 1.25.2 with pip install numpy==1.25.2(see here).


Finally, I just installed bayes-toolbox on a different Macbook with the following steps and successfully ran BEST.ipynb from inside the examples directory after downloading bayes-toolbox from GitHub: 1) Created a new Python 3.11 environment with: conda create -n test python=3.11 2) conda activate test 3) pip install bayes_toolbox 4) pip install jupyterlab 5) pip install seaborn 6) pip install --user ipykernel 7) python -m ipykernel --user --name=test 8) python -m jupyter lab 9) Opened BEST.ipynb and changed kernel to "test" 10) Select from Kernel dropdown of JupyterLab: "Restart Kernel and Run All"

I hope this works! If not, I'll have to do some digging after the holidays. Good luck!

DLWCMD commented 8 months ago

Thanks for the follow up. Some points:

Thanks again for your patience and support.

From: Hyosub Kim @.> Reply-To: hyosubkim/bayes-toolbox @.> Date: Monday, December 18, 2023 at 11:53 PM To: hyosubkim/bayes-toolbox @.> Cc: DLWCMD @.>, Author @.***> Subject: Re: [hyosubkim/bayes-toolbox] Cannot Install bayes-toolbox (Issue #19)

No problem, David. I just want installation to be easier for folks so that they can actually use bayes-toolbox.

I looked up the NumPy error you were receiving:

AttributeError: module 'numpy.config' has no attribute 'get_info'

Not sure why this should work, but others using pymc have also ran into problems and fixed it by upgrading to numpy 1.25.2 with pip install numpy==1.25.2(see herehttps://github.com/pymc-devs/pymc/issues/7043).


Finally, I just installed bayes-toolbox on a different Macbook with the following steps and successfully ran BEST.ipynb from inside the examples directory after downloading bayes-toolbox from GitHub:

  1. Created a new Python 3.11 environment with: conda create -n test python=3.11
  2. conda activate test
  3. pip install bayes_toolbox
  4. pip install jupyterlab
  5. pip install seaborn
  6. pip install --user ipykernel
  7. python -m ipykernel --user --name=test
  8. python -m jupyter lab
  9. Opened BEST.ipynb and changed kernel to "test"
  10. Select from Kernel dropdown of JupyterLab: "Restart Kernel and Run All"

I hope this works! If not, I'll have to do some digging after the holidays. Good luck!

— Reply to this email directly, view it on GitHubhttps://github.com/hyosubkim/bayes-toolbox/issues/19#issuecomment-1862115686, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALUME6UTGJLF2SHCY5NL6VLYKEMVVAVCNFSM6AAAAABAQBRCOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRSGEYTKNRYGY. You are receiving this because you authored the thread.Message ID: @.***>