GithubHelp home page GithubHelp logo

Comments (16)

darikg avatar darikg commented on June 12, 2024 1

that's super weird. It looks like read_excel has an engine option, and openpyxl is used by default for xlsx files. Maybe check if just importing openpyxl without reading a file is enough to also break the plotter? Or check if the calamine engine also breaks it?

from pyvista.

darikg avatar darikg commented on June 12, 2024 1

Yeah, in a new Windows python 3.11 environment, pip install -r bug_requirements.txt, jupyter lab in chrome,

import openpyxl
from pyvista import Sphere
Sphere().plot()

works fine 😕

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

I've not contributed to PyVista before. But if it's helpful, I'm happy to take a crack at it if someone can point me in the right direction.

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

Looks like it may be related to the openpyxl engine like you suspected. import openpyxl is sufficient to reproduce the issue. Works fine with calamine. I upgraded to pandas 2.2.2 and the issue persists.

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

I also called the imports from the openpyxl __init__.py individually.

from openpyxl.compat.numbers import NUMPY
from openpyxl.xml import DEFUSEDXML, LXML
from openpyxl.workbook import Workbook
from openpyxl.reader.excel import load_workbook as open
from openpyxl.reader.excel import load_workbook
import openpyxl._constants as constants

Calling any one of these imports was sufficient sufficient to reproduce the issue.

from pyvista.

darikg avatar darikg commented on June 12, 2024

I think any sort of from openpyxl import ... is equivalent to import openpyxl so it makes sense any one of those imports will cause the same problem. What about import lxml?

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

works fine with import lxml

from pyvista.

darikg avatar darikg commented on June 12, 2024

I'm at a loss. It doesn't seem like openpyxl is really importing anything that could do this. What version of openpyxl do you have? I just installed 3.1.2 and am unable to replicate.

from pyvista.

tkoyama010 avatar tkoyama010 commented on June 12, 2024

That's really weird.

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

Are you using the notebook backend @darikg? I created a new environment from scratch, and it does work with just pip install pyvista openpyxl. I get a warning saying that the notebook backend can't be used because trame is not installed, so I think that plot is not interactive. When I did pip install pyvista[jupyter] to get trame and the other backend components for Jupyter, the bug reappeared. I've attached a file with the environment needed for the bug to appear on my machine (pip install pandas pyvista[jupyter]).

bug_requirements.txt

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

I wondered if it was maybe related to me using a Notebook inside VSCode. I opened the notebook in Chrome and that didn't fix it either.

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

What if you swap the import order? I have typically been importing openpyxl after pyvista.

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

I just ran your code and was still encountering this bug. So I guess the order doesn't matter for me. So strange. My Python version in this environment is 3.12.2. Otherwise I'm totally at a loss...

from pyvista.

darikg avatar darikg commented on June 12, 2024

just checked python 3.12.2 for completeness' sake, and it's fine regardless of import order. you're on windows too? i'm willing to blame some sort of poltergeist at this point

from pyvista.

mdmelin avatar mdmelin commented on June 12, 2024

Yeah Windows 10. Weird that I consistently have the issue in fresh environments. Maybe my anaconda installation is a bit messed up. Anyways if no one else can replicate it guess we should leave it alone for now.

from pyvista.

darikg avatar darikg commented on June 12, 2024

Yeah sorry! I'm really curious what's causing this but don't have any ideas for further isolating it.

from pyvista.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.