OSError: [WinError 123] Syntax error in file name, folder name, or volume label

Question:

I am a beginner Python user. I ran into a problem when installing the "Kivy" package, even any package, I get an error "OSError: [WinError 123] Syntax error in file name, folder name, or volume label".

Here my error:

ERROR: Exception:
Traceback (most recent call last):
  File "D:AHProjectvenvlibsite-packagespip_internalclibase_command.py", line 160, in exc_logging_wrapper
    status = run_func(*args)
  File "D:AHProjectvenvlibsite-packagespip_internalclireq_command.py", line 247, in wrapper
    return func(self, options, args)
  File "D:AHProjectvenvlibsite-packagespip_internalcommandsinstall.py", line 553, in run
    self._handle_target_dir(
  File "D:AHProjectvenvlibsite-packagespip_internalcommandsinstall.py", line 563, in _handle_target_dir
    ensure_dir(target_dir)
  File "D:AHProjectvenvlibsite-packagespip_internalutilsmisc.py", line 105, in ensure_dir
    os.makedirs(path)
  File "D:Python3.10libos.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "D:Python3.10libos.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] Syntax error in file name, folder name, or volume label: 'D:\AHProject\~\D:'

I have already shoveled the entire Internet but did not find a solution to the problem on my question. I’m working with PyCharm, but even when I try install package in cmd I have the same error.

Asked By: Artem Hostintsev

||

Answers:

The problem was solved by installing Anaconda and for me everything works now

Answered By: Artem Hostintsev
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.