Pandas dataframe in python desktop app (platypus)

202 Views Asked by At

Is it possible to create a desktop app on mac with platypus if the py script contains a pandas dataframe? I tried it and I get ImportError: No module nammed pandas
What do I have to do to make it run?

1

There are 1 best solutions below

1
On

If you create a new Python project in PyCharm and try to import the Pandas library, it’ll throw the following error:

Traceback (most recent call last):
  File "C:/Users/xcent/Desktop/Finxter/Books/book_dash/pythonProject/main.py", line 1, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'

Process finished with exit code 1 The reason is that each PyCharm project, per default, creates a virtual environment in which you can install custom Python modules. But the virtual environment is initially empty—even if you’ve already installed Pandas on your computer!

Here’s a screenshot:

The fix is simple: Use the PyCharm installation tooltips to install Pandas in your virtual environment—two clicks and you’re good to go!

First, right-click on the pandas text in your editor:

Second, click “Show Context Actions” in your context menu. In the new menu that arises, click “Install Pandas” and wait for PyCharm to finish the installation.

The code will run after your installation completes successfully.