# Cannot install psychopy in venv in vscode

**URL:** <https://discourse.psychopy.org/t/cannot-install-psychopy-in-venv-in-vscode/42742>\
**Category:** Coding\
**Created:** [October 30, 2024, 2:42pm UTC](https://discourse.psychopy.org/t/cannot-install-psychopy-in-venv-in-vscode/42742 "2024-10-30T14:42:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zyadelmahdy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/zyadelmahdy/32/42902_2.png) [@zyadelmahdy](https://discourse.psychopy.org/u/zyadelmahdy)\
**Post date:** [October 30, 2024, 2:42pm UTC](https://discourse.psychopy.org/t/cannot-install-psychopy-in-venv-in-vscode/42742/1 "2024-10-30T14:42:28Z")

</div>

Unfortunately, I followed the steps provided in this answer:

> [@Cannot install psychopy through pip on MacOS M2](https://discourse.psychopy.org/t/cannot-install-psychopy-through-pip-on-macos-m2/35873/2):
>
> For anyone encountering this in future. I ran: brew install hdf5 then export HDF5\_DIR=/opt/homebrew/Cellar/hdf5/1.14.3/ then pip3 install psychopy and this worked! Try to find the location of your H5public.h file to replace the path in the export line

but I keep getting this error on MacOS. I downgraded Python to 3.8.10 as per some online recommendations:  
AttributeError: module ‘pkgutil’ has no attribute ‘ImpImporter’. Did you mean: ‘zipimporter’?  
Then I started getting another error message.  
Full error:

/zyadelmahdy/Documents/the talking mouse (psychopy)/.venv/include" -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c Modules/objc/class-builder.m -o build/temp.macosx-10.9-universal2-cpython-311/Modules/objc/class-builder.o -g -fexceptions -Wall -Wstrict-prototypes -Wmissing-prototypes -Wformat=2 -W -Wpointer-arith -Wmissing-declarations -Wnested-externs -W -Wno-import -Wno-unknown-pragmas -Wshorten-64-to-32 -Werror -I/usr/include/ffi -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -DPyObjC\_BUILD\_RELEASE=1501  
Modules/objc/class-builder.m:1773:17: error: code will never be executed [-Werror,-Wunreachable-code]  
1773 | PyMem\_Free(argbuf);  
| ^ ~~~~~~~~~  
Modules/objc/class-builder.m:1538:27: error: code will never be executed [-Werror,-Wunreachable-code]  
1538 | theSelector = @selector(init);  
| ^ ~~~~~~~~~~~~~~  
2 errors generated.  
error: command ‘/usr/bin/clang’ failed with exit code 1  
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.  
ERROR: Failed building wheel for pyobjc-core  
Running setup.py clean for pyobjc-core  
Failed to build wxPython pyobjc-core  
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (wxPython, pyobjc-core)
