4

I created a simple batch file to activate an Environment and then run spyder.

@echo off
call activate env
spyder.exe
exit

Now the problem is that the CMD remains open after the execution and it's attached to spyder meaning that if I close it Spyder exits as well with the following message.

forrtl: error (200): program aborting due to window-CLOSE event
Image              PC                Routine            Line        Source
libifcoremd.dll    00007FF8D20694C4  Unknown               Unknown  Unknown
KERNELBASE.dll     00007FF917927EDD  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FF918D91FE4  Unknown               Unknown  Unknown
ntdll.dll          00007FF91ACECB31  Unknown               Unknown  Unknown
QObject::~QObject: Timers cannot be stopped from another thread 

I actually tried the following code as well, after suggestions from here and other similar posts. The only difference now is that cmd closes but another window stays open in its place. The icon of the new window is not the cmd icon.

@echo off
call activate env
start spyder.exe
exit

Furthermore, I tried

cmd "/c activate env && start spyder" 

which has the same result as the first batch

cmd "/c activate env && spyder && exit"

which exits before it does anything and

cmd "/c activate env && start spyder && exit"

which has the same result as the second batch

Does anyone have a solution to that? Thanks

Pasc Peli
  • 41
  • 1
  • 7

2 Answers2

1

You can achieve what you're trying to do by pasting the following into a batch file (.bat) or a shortcut path:

C:\Anaconda3\pythonw.exe C:\Anaconda3\cwp.py C:\Anaconda3\envs\py38 C:\Anaconda3\envs\py38\pythonw.exe C:\Anaconda3\envs\py38\Scripts\spyder-script.py

This will activate the python environment called py38 and launch spyder without opening the cmd window.

jaklins7
  • 11
  • 1
0

I suggest using the small extra program RUNNHIDE, as documented on Rob van der Woude's site.

RUNNHIDE.EXE spyder.exe
MonkeyPushButton
  • 1,077
  • 10
  • 19