# PsychoPy not starting in virtual environment

**URL:** <https://discourse.psychopy.org/t/psychopy-not-starting-in-virtual-environment/35187>\
**Category:** Other\
**Tags:** anaconda\
**Created:** [June 1, 2023, 7:44am UTC](https://discourse.psychopy.org/t/psychopy-not-starting-in-virtual-environment/35187 "2023-06-01T07:44:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninrad](https://avatars.discourse-cdn.com/v4/letter/n/e274bd/32.png) [@ninrad](https://discourse.psychopy.org/u/ninrad)\
**Post date:** [June 1, 2023, 7:44am UTC](https://discourse.psychopy.org/t/psychopy-not-starting-in-virtual-environment/35187/1 "2023-06-01T07:44:34Z")

</div>

Hi there

We are using PsychoPy 2022.1.1 for our fMRI experiments. Some time ago, we followed the installation guide from PsychoPy ([Installation — PsychoPy v2023.1.2](https://psychopy.org/download.html#anaconda-and-miniconda)) to install a virtual environment with this specific version of PsychoPy.

We used the following settings in the environment file:  
name: psychopy  
channels:

- conda-forge  
dependencies:
- python=3.8
- psychopy=2022.1.1
- pip
- pip:
  - psychtoolbox
  - pygame
  - pyo
  - pyparallel; platform\_system != “Windows”
  - SoundFile; platform\_system == “Windows”
  - websocket\_client

Initially, everything was working fine, but within the past two weeks, we have encountered an issue. Although we can activate the virtual environment, as soon as we try to open PsychoPy within the environment, the splash image appears briefly, followed by an immediate shutdown of PsychoPy. We have checked the conda prompt for any error messages, but none are displayed. Despite attempting to reinstall the entire environment, the problem persists. We are currently at a loss as to where to look for the source of this problem.

If anyone has any tips or suggestions on where to investigate or how to troubleshoot this issue, we would greatly appreciate the assistance.

Many thanks in advance

Nina

---

<div class="post-metadata">

**Author:** ![TParsons](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/tparsons/32/8301_2.png) [@TParsons](https://discourse.psychopy.org/u/TParsons)\
**Post date:** [June 1, 2023, 11:14am UTC](https://discourse.psychopy.org/t/psychopy-not-starting-in-virtual-environment/35187/2 "2023-06-01T11:14:26Z")

</div>

You could check the log file - when the crash happens from the app starting, sometimes error messages are swallowed up before they make it to the console, but they still appear in the log file. It’ll be in your AppData folder, on Windows it’s:  
"%AppData%/psychopy3/last\_app\_load.log

---

<div class="post-metadata">

**Author:** ![ninrad](https://avatars.discourse-cdn.com/v4/letter/n/e274bd/32.png) [@ninrad](https://discourse.psychopy.org/u/ninrad)\
**Post date:** [June 5, 2023, 9:22am UTC](https://discourse.psychopy.org/t/psychopy-not-starting-in-virtual-environment/35187/3 "2023-06-05T09:22:36Z")

</div>

Thanks!

We found the error message, which was

> File “D:\conda\_envs\env\_CBC\_old\lib\subprocess.py”, line 1311, in \_execute\_child  
> hp, ht, pid, tid = \_winapi.CreateProcess(executable, args,  
> FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden  
> 49.6701 ERROR Package `jedi` not installed, code auto-completion and calltips will not be available.

Which is a bit weird since ‘jedi’ was never installed as a package in the environment even when PsychoPy was still running. Anyway, we then installed the package and after that the error messag is this:

> File “D:\conda\_envs\env\_viwotrain\lib\subprocess.py”, line 1311, in \_execute\_child  
> hp, ht, pid, tid = \_winapi.CreateProcess(executable, args,  
> FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden  
> _(Translation: FileNotFoundError: [WinError 2] The system cannot find the specified file.)_

But we are not sure which file it can’t find because the subprocesses.py is in the folder where it is specified before the error message.

Also, the same error message occurs when trying to install packages in PyCharm. Therefore, we assume that this is more a global problem and not a problem related to PsychPy or the virtual environment. But we still don’t know where to look for the problem.

Best wishes,

Nina

> **complete logfile**
>
> > pygame 2.1.2 (SDL 2.0.18, Python 3.8.13)  
> > Hello from the pygame community. [Contribute - pygame wiki](https://www.pygame.org/contribute.html)  
> > D:\conda\_envs\env\_viwotrain\lib\site-packages\pyglet\media\codecs\wmf.py:838: UserWarning: [WinError -2147417850] Der Threadmodus kann nicht nach dem Einstellen geändert werden  
> > warnings.warn(str(err))  
> > PTB-INFO: Using modified PortAudio V19.7.0-devel, revision unknown  
> > 2.4906 DEBUG Opening message catalog D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\localization..\app\locale\de\_CH\LC\_MESSAGE\messages.mo for locale de\_CH  
> > 2.4909 DEBUG Locale for ‘de\_CH’ not found. Using default.  
> > 41.4017 WARNING Speech-to-text recognition module for PocketSphinx is not available (use command `pip install SpeechRecognition` to get it). Transcription will be unavailable using that service this session.  
> > 41.4028 WARNING Speech-to-text recognition using Google online services is not available (use command `pip install google-api-core google-auth google-cloud google-cloud-speech googleapis-common-protos` to get it). Transcription will be unavailable using that service this session.  
> > 41.5574 INFO Loaded SoundDevice with PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4  
> > 41.5575 INFO sound is using audioLib: sounddevice  
> > 41.5575 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘sounddevice’, ‘PTB’, ‘pyo’, ‘pygame’] (in that order).  
> > Traceback (most recent call last):  
> > File “D:\conda\_envs\env\_viwotrain\Scripts\psychopy-script.py”, line 10, in   
> > sys.exit(main())  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\psychopyApp.py”, line 98, in main  
> > start\_app()  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\psychopyApp.py”, line 26, in start\_app  
> > app = startApp(showSplash=showSplash)  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\__init_\_.py”, line 64, in startApp  
> > _psychopyApp = PsychoPyApp(  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\_psychopyApp.py”, line 215, in **init**  
> > self.onInit(testMode=testMode, \*\*kwargs)  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\_psychopyApp.py”, line 265, in onInit  
> > from psychopy.app import coder, builder, runner, dialogs  
> > File "D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\builder\_init_.py", line 5, in   
> > from .builder import BuilderFrame  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\builder\builder.py”, line 120, in   
> > class BuilderFrame(wx.Frame, ThemeMixin):  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\builder\builder.py”, line 123, in BuilderFrame  
> > routineTemplates = TemplateManager()  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\builder\builder.py”, line 105, in **init**  
> > self.updateTemplates()  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\app\builder\builder.py”, line 112, in updateTemplates  
> > thisExp = experiment.Experiment()  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\experiment\_experiment.py”, line 137, in **init**  
> > self.settings = _settingsComp(parentName=‘’, exp=self)  
> > File "D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\experiment\components\settings\_init_.py", line 200, in **init**  
> > allowedVals=versions.\_versionFilter(versions.versionOptions(), wx. **version** )  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\tools\versionchooser.py”, line 215, in versionOptions  
> > for v in availableVersions(local=local)}),  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\tools\versionchooser.py”, line 300, in availableVersions  
> > return \_localVersions(forceCheck)  
> > File “D:\conda\_envs\env\_viwotrain\lib\site-packages\psychopy\tools\versionchooser.py”, line 230, in \_localVersions  
> > tagInfo = subprocess.check\_output(cmd.split(), cwd=VERSIONSDIR,  
> > File “D:\conda\_envs\env\_viwotrain\lib\subprocess.py”, line 415, in check\_output  
> > return run(\*popenargs, stdout=PIPE, timeout=timeout, check=True,  
> > File “D:\conda\_envs\env\_viwotrain\lib\subprocess.py”, line 493, in run  
> > with Popen(\*popenargs, \*\*kwargs) as process:  
> > File “D:\conda\_envs\env\_viwotrain\lib\subprocess.py”, line 858, in **init**  
> > self.\_execute\_child(args, executable, preexec\_fn, close\_fds,  
> > File “D:\conda\_envs\env\_viwotrain\lib\subprocess.py”, line 1311, in \_execute\_child  
> > hp, ht, pid, tid = \_winapi.CreateProcess(executable, args,  
> > FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden
