TypeError: unsupported operand type(s) for |: 'type' and 'type'

Installing and setting up FaceSwap


Forum rules

Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.

Post Reply
User avatar
ryanbin
Posts: 1
Joined: Fri Nov 15, 2024 12:00 am

TypeError: unsupported operand type(s) for |: 'type' and 'type'

Post by ryanbin »

Getting the following error when trying to run python faceswap.py -h

Traceback (most recent call last):
File "/home/ryan/faceswap/faceswap.py", line 12, in <module>
from lib.cli import args as cli_args # pylint:disable=wrong-import-position
File "/home/ryan/faceswap/lib/init.py", line 4, in <module>
from . import logger
File "/home/ryan/faceswap/lib/logger.py", line 427, in <module>
def _stream_handler(loglevel: int, is_gui: bool) -> logging.StreamHandler | TqdmHandler:
TypeError: unsupported operand type(s) for |: 'type' and 'type'

I used the faceswap_setup_x64.sh script to install on two different machines (Ubuntu 20.04 and CentOS9) and get the exact same error.

User avatar
torzdf
Posts: 2761
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 141 times
Been thanked: 643 times

Re: TypeError: unsupported operand type(s) for |: 'type' and 'type'

Post by torzdf »

You are using an old version of Python which means that you have probably not activated your Faceswap environment

My word is final

Post Reply