Davide-sd / sympy-plot-backends

An improved plotting module for SymPy
BSD 3-Clause "New" or "Revised" License
42 stars 9 forks source link

Installation Error #18

Closed timhockswender closed 10 months ago

timhockswender commented 1 year ago

Hi, i have attempted to add the backend to my environments with either python 3.0 or 3.11. Both had current sympy and matplotlib. Using Miniconda under win11. All trials have led to the error: Output in format: Requested package -> Available versions with no more detail. I can individually add all the required packages but when I get to the backend I get several pages of incompatible packages.

A google search discovered the identical problem installinf something called 'matminer', eventually pointing to conda forcing a file to add which should have not been there.

The system did send a notification to conda with the problem. Any insight would be appreciated. Tim

Davide-sd commented 1 year ago

Hello Tim,

I definitely have to figure out what's wrong with the conda build, unfortunately none of the error message are useful :| I also have to add Python 3.11 to the builds.

I've been able to install the module following these steps. For Python 3.11:

conda install -c conda-forge mergedeep appdirs packaging
conda install -c conda-forge matplotlib sympy adaptive
pip install sympy_plot_backends

For Python 3.10:

conda install -c conda-forge mergedeep appdirs packaging
conda install -c conda-forge matplotlib sympy adaptive
conda install -c davide_sd sympy_plot_backends 

Then, if you want the full capabilities:

conda install -c anaconda scipy notebook
conda install -c conda-forge ipympl panel k3d msgpack-python
conda install -c bokeh ipywidgets_bokeh colorcet
conda install -c plotly plotly
conda install -c conda-forge vtk
timhockswender commented 1 year ago

Hi Davide, Thanks for the help. I tried both approaches. Using 3.10.9 failed your 3.10 outline. I was able to use the 3.11 outline to install and started working with it. So far, only the MB backend works. The PM and BB examples fail to find some components. I did or install plotless or bokeh, should I?

The error message from the 3.10 occurred only at the last step to install the backend. It said “ CondaVerificationError: The package for sympy_plot_backends located at C:\Users\timho\miniconda3\pkgs\sympy_plot_backends-1.6.6-py310_0 appears to be corrupted. The path 'Lib/0/site-packages/sympy_plot_backends-1.6.6.dist-info/top_level.txt' specified in the package manifest cannot be found. " Maybe this helps. Regards, Tim

Sent from my iPad

On Feb 11, 2023, at 8:22 AM, Davide Sandonà @.***> wrote:



Hello Tim,

I definitely have to figure out what's wrong with the conda build, unfortunately none of the error message are useful :| I also have to add Python 3.11 to the builds.

I've been able to install the module following these steps. For Python 3.11:

conda install -c conda-forge mergedeep appdirs packaging conda install -c conda-forge matplotlib sympy adaptive pip install sympy_plot_backends

For Python 3.10:

conda install -c conda-forge mergedeep appdirs packaging conda install -c conda-forge matplotlib sympy adaptive conda install -c davide_sd sympy_plot_backends

— Reply to this email directly, view it on GitHub https://github.com/Davide-sd/sympy-plot-backends/issues/18#issuecomment-1426768365, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZODOF3P7CKJ3XEXMSIRSLWW6HCNANCNFSM6AAAAAAUYBWEOQ . You are receiving this because you authored the thread.Message ID: @.***>

Davide-sd commented 1 year ago

To use PB and BB you have to install plotly and bokeh.

conda install -c bokeh bokeh ipywidgets_bokeh
conda install -c plotly plotly

The error message from the 3.10 occurred only at the last step to install the backend

Unfortunately, I'm unable to replicate this ...

timhockswender commented 1 year ago

To add on, I installed plotly and bokeh.restated kernel. Cell 4 results in:

C:\Users\timho\miniconda3\envs\sympy311\Lib\site-packages\spb\backends\plotly.py:152: UserWarning: plotly version is too old to use (5.0.0 or newer required) plotly = import_module(

---------------------------------------------------------------------------AttributeError Traceback (most recent call last) Cell In[4], line 1----> 1 plot(sin(x), cos(x), log(x), backend=PB)

File ~\miniconda3\envs\sympy311\Lib\site-packages\spb\functions.py:669, in plot(args, kwargs) 666 series += _create_generic_data_series(kwargs) 668 Backend = kwargs.pop("backend", TWO_D_B)--> 669 return _instantiate_backend(Backend, series, **kwargs)

File ~\miniconda3\envs\sympy311\Lib\site-packages\spb\utils.py:402, in _instantiate_backend(Backend, *series, kwargs) 401 def _instantiate_backend(Backend, *series, *kwargs):--> 402 p = Backend(series, kwargs) 403 _validate_kwargs(p, **kwargs) 405 if kwargs.get("show", True):

File ~\miniconda3\envs\sympy311\Lib\site-packages\spb\backends\plotly.py:157, in PlotlyBackend.init(self, *args, *kwargs) 151 def init(self, args, **kwargs): 152 plotly = import_module( 153 'plotly', 154 import_kwargs={'fromlist': ['graph_objects', 'figure_factory']}, 155 warn_not_installed=True, 156 min_module_version='5.0.0')--> 157 go = plotly.graph_objects 159 # The following colors corresponds to the discret color map 160 # px.colors.qualitative.Plotly. 161 self.colorloop = [ 162 "#636EFA", "#EF553B", "#00CC96", "#AB63FA", "#FFA15A", 163 "#19D3F3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52"] AttributeError: 'NoneType' object has no attribute 'graph_objects'

On Sat, Feb 11, 2023 at 8:22 AM Davide Sandonà @.***> wrote:

Hello Tim,

I definitely have to figure out what's wrong with the conda build, unfortunately none of the error message are useful :| I also have to add Python 3.11 to the builds.

I've been able to install the module following these steps. For Python 3.11:

conda install -c conda-forge mergedeep appdirs packaging conda install -c conda-forge matplotlib sympy adaptive pip install sympy_plot_backends

For Python 3.10:

conda install -c conda-forge mergedeep appdirs packaging conda install -c conda-forge matplotlib sympy adaptive conda install -c davide_sd sympy_plot_backends

— Reply to this email directly, view it on GitHub https://github.com/Davide-sd/sympy-plot-backends/issues/18#issuecomment-1426768365, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZODOF3P7CKJ3XEXMSIRSLWW6HCNANCNFSM6AAAAAAUYBWEOQ . You are receiving this because you authored the thread.Message ID: @.***>

Davide-sd commented 1 year ago

That's because conda installed an old version of Plotly.

Besides, I think you are mixing a lot of stuff. Which Python version are you using? Because:

And most importantly, why are you using conda?

timhockswender commented 1 year ago

Hi Davide, I am still having issues. I needed to update conda then it would finally update plotly and Bokeh. I was able to create an environment that mostly works. Below I will add some observations, but to help, here is a request: Could you send me a working environment by activating the environment then run 'conda list --explicit >envname.txt' then sending me the text file? You may know that I can recreate the env at my end. An alternative would be for me to send you mine for you to examine but it's my problem so I should check it. Thanks, Tim Notes: Tutorial 1.2D: plotly backend gives: "<spb.backends.plotly.PlotlyBackend at 0x28e27a98850" but no actual plot. It does leave whitespace. First cell with BB: bokeh backend gives: "Value Error: failed to validate FigureOptions(...).x_range: expected an element of either Instance(Range), Either(Tuple(Float, Float), Tuple(Datetime, Datetime), Tuple(TimeDelta, TimeDelta)), Seq(String), Object(Series) or Object(GroupBy), got None"

Also in running Tutorial 10, all the cells executed well but eventually led to a warning. Perhaps related to the Plotly issue. The warning was:"C:\Users\timho\miniconda3\envs\sympy311\Lib\site-packages\spb\backends\matplotlib.py:234: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (matplotlib.pyplot.figure) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam figure.max_open_warning). Consider using matplotlib.pyplot.close(). self._fig = self.plt.figure(figsize=self.size) I added import matplotlib as mpl then executed mpl.pyplot.close(). This stopped the error message.

On Sun, Feb 12, 2023 at 4:16 AM Davide Sandonà @.***> wrote:

That's because conda installed an old version of Plotly. Run this:

conda update plotly

Then it should work.

— Reply to this email directly, view it on GitHub https://github.com/Davide-sd/sympy-plot-backends/issues/18#issuecomment-1426982051, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZODOCFOPLU4TRAX6KHFSLWXCS7DANCNFSM6AAAAAAUYBWEOQ . You are receiving this because you authored the thread.Message ID: @.***>

Davide-sd commented 1 year ago

Could you send me a working environment by activating the environment then run 'conda list --explicit >envname.txt' then sending me the text file?

Here it is (Python 3.10). I deleted the 3.11 a few days ago because I needed the disk space. test_plot2.txt

Seems like you are following the notebooks on the Github repository. Keep in mind that they might be obsolete... Nonetheless, the plots should be visible.

First cell with BB: bokeh backend gives: "Value Error: failed to validate FigureOptions(...)

Which Bokeh version are you using?

More than 20 figures have been opened.

That's standard Matplotlib behaviour, I don't think that I can modify that.

timhockswender commented 1 year ago

Still a problem. There is no backend package in the file. After some tests, only files installed by conda will carry over. Files installed by pip will not. I have been unable to install via conda, even into a purely empty environment. As an aside, i was using a more recent version of bokeh as shown in your file. If a conda install can work, I can check the bokeh version question. I have never tried to create a conda package but can try to work on this one if you would like. tim

On Fri, Feb 17, 2023 at 11:30 AM Davide Sandonà @.***> wrote:

Could you send me a working environment by activating the environment then run 'conda list --explicit >envname.txt' then sending me the text file?

Here it is (Python 3.10). I deleted the 3.11 a few days ago because I needed the disk space. test_plot2.txt https://github.com/Davide-sd/sympy-plot-backends/files/10768816/test_plot2.txt

Seems like you are following the notebooks on the Github repository. Keep in mind that they might be obsolete... Nonetheless, the plots should be visible.

First cell with BB: bokeh backend gives: "Value Error: failed to validate FigureOptions(...)

Which Bokeh version are you using?

More than 20 figures have been opened.

That's standard Matplotlib behaviour, I don't think that I can modify that.

— Reply to this email directly, view it on GitHub https://github.com/Davide-sd/sympy-plot-backends/issues/18#issuecomment-1434882819, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZODOBAGMROYZ7RR222YM3WX6RRNANCNFSM6AAAAAAUYBWEOQ . You are receiving this because you authored the thread.Message ID: @.***>

Davide-sd commented 1 year ago

 have never tried to create a conda package but can try to work on this one if you would like

Feel free to give it a try. There is likely some wrong configuration on the recepe build. Honestly, I am totally unfamiliar with conda...

Regarding Bokeh, this module has been implemented with Bokeh 2.something. I've seen they have recently released version 3 so I'll try next week to see what need to be changed. However, Bokeh is installed as a dependency by Panel, which currently requires Bokeh 2.something.

Davide-sd commented 1 year ago

I created a new installation recipe for conda. Give it a try and let me know.

timhockswender commented 1 year ago

Hi Davide, I started from scratch with: conda create -c conda-forge -n sympy_310b python=3.1 ipykernel ipympl spyder-kernels=2.4 sympy plotly sympy_plot_backends and it worked well. I needed to install nbformat from a message when running a tutorial . Note that spyder kernels is needed to run using the spyder ide. Looks good so far but couldn't find the other tutorials on github. 404 error. Can you update references or send them via zip file? Thanks much for following up on this. Regards, Tim

On Wed, Mar 29, 2023 at 3:38 AM Davide Sandonà @.***> wrote:

I created a new installation recipe for conda https://github.com/conda-forge/sympy_plot_backends-feedstock. Give it a try and let me know.

— Reply to this email directly, view it on GitHub https://github.com/Davide-sd/sympy-plot-backends/issues/18#issuecomment-1488092090, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZODOA2NMRVZGZBXYIY6FDW6PRILANCNFSM6AAAAAAUYBWEOQ . You are receiving this because you authored the thread.Message ID: @.***>

Davide-sd commented 1 year ago

Hello Tim, I removed the Jupyter Notebook tutorials for the following reasons:

If you really want the notebook tutorials, you can download the source code of a previous release, but you probably have to modify some commands (you can find them in the Releases page, here is the source code for v1.6.7, the last one containing the notebooks tutorials).