Python Forum
Module which run in PyCharm but not as exe or terminal.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Module which run in PyCharm but not as exe or terminal.
#1
Hello everyone,

I've built a nice moduel using pandas, pyodbc and tkinter. Everything looks fime when I trigegr the module from PyCharm. However, I built the exe using pyinstaller and it returns Failed to Execute the Script. No idea how can I retrieve the error.
Second, I tried to run the module from the terminal and it retrieves ImportError: No module named pandas.

Quite confuse, in PyCharm works, as exe not and as terminal neither.

What shall I do/check?

Many Thanks
Reply
#2
Do you have more than one python version installed?
In pycharm, in project settings, check which interpreter is used to run the script. make sure you use the same python interpreter when run the script from terminal/cmd and when compile the exe with pyinstaller.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
The PyCharm interpreter is Python 3.7
In CMD when I didgit python I got Python 3.7.2
The same in the terminal

What should I check more?

Moreover, it looks that happen only with pandas (or at least for sure with pandas). I am using pyinstaller for modules without pandas and it works fine.

Confused.
Reply
#4
I faced the similar Problem, Here's what I did:

try running .py file on python shell, You might get a Module import Error.

1. open the cmd prompt where the python file is stored and start importing the packages using pip install package-name

2.Now try running your python file in the cmd prompt to ensure there are no errors

3. Delete the .exe file and reinstall it again using pyinstaller

4. Run the .exe file
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  keyboard module doesn't work in the microsoft version terminal of python. username 1 2,748 Feb-25-2021, 05:19 PM
Last Post: Larz60+
  Python Program Runs in Pycharm but not in Terminal Vbhardwaj2383 2 3,245 Apr-06-2020, 04:41 PM
Last Post: Vbhardwaj2383
  Pycharm Cannot Find Pygame Module Myang123 2 5,929 Aug-07-2019, 01:26 AM
Last Post: Myang123
  Auto activate conda env in Pycharm terminal ntuttle 0 4,730 Mar-08-2019, 03:56 PM
Last Post: ntuttle
  Random module works in idle but not terminal. ottowiser 3 5,460 Apr-11-2018, 10:59 PM
Last Post: ottowiser
  python turtle module in pycharm error sajley 2 12,987 Dec-12-2016, 08:52 PM
Last Post: sajley

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020