-
-
Notifications
You must be signed in to change notification settings - Fork 439
Install error on Windows 11 Chinese Version #3485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem lies in your system, where it can't compile msgpack on Python 3.13 Try fixing the compiling issue or using an older Python version. |
@JamCh01 May be you can use pipx to install pdm: python -m pip install --upgrade --user pip pipx
python -m pipx ensurepath
python -m pipx install pdm If it not work either, you can use json to replace msgpack(src/pdm/models/serializers.py): try:
import msgpack
except ImportError:
import base64
import json
class Encoder(json.JSONEncoder):
bytes_ident = "PDM_BYTES_OBJECT"
def default(self, obj: Any) -> Any:
if isinstance(obj, bytes):
return {
"type": self.bytes_ident,
"val": base64.b64encode(obj).decode(),
}
return super().default(obj)
def object_hook(obj: Any) -> Any:
if isinstance(obj, dict) and obj.get("type") == Encoder.bytes_ident:
val = obj.get("val")
if val is not None and isinstance(val, str):
return base64.b64decode(val)
return obj
class msgpack:
UnpackValueError = json.JSONDecodeError
@staticmethod
def packb(data: dict, use_bin_type: bool = True) -> bytes:
return json.dumps(data, cls=Encoder).encode()
@staticmethod
def loads(data: bytes, raw: bool = False) -> Any:
return json.loads(data, object_hook=object_hook)
git clone https://github.com/pdm-project/pdm
cd pdm
vi src/pdm/models/serializers.py
pipx install -e .
pdm --version |
@frostming MessagePack is not so mature as JSON. How about use |
python 3.12.10 have same issue but with pdm init. Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "c:\users\chen\appdata\roaming\python\scripts\pdm.exe\__main__.py", line 7, in <module>
File "C:\Users\chen\AppData\Roaming\pdm\venv\Lib\site-packages\pdm\core.py", line 391, in main
return core.main(args or sys.argv[1:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\chen\AppData\Roaming\pdm\venv\Lib\site-packages\pdm\core.py", line 270, in main
raise cast(Exception, err).with_traceback(traceback) from None
File "C:\Users\chen\AppData\Roaming\pdm\venv\Lib\site-packages\pdm\core.py", line 265, in main
self.handle(project, options)
File "C:\Users\chen\AppData\Roaming\pdm\venv\Lib\site-packages\pdm\core.py", line 195, in handle
command.handle(project, options)
File "C:\Users\chen\AppData\Roaming\pdm\venv\Lib\site-packages\pdm\cli\commands\init.py", line 295, in handle
actions.ask_for_import(project)
File "C:\Users\chen\AppData\Roaming\pdm\venv\Lib\site-packages\pdm\cli\actions.py", line 313, in ask_for_import
importable_files = list(find_importable_files(project))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\chen\AppData\Roaming\pdm\venv\Lib\site-packages\pdm\cli\utils.py", line 578, in find_importable_files
if module.check_fingerprint(project, project_file.as_posix()):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\chen\AppData\Roaming\pdm\venv\Lib\site-packages\pdm\formats\flit.py", line 29, in check_fingerprint
data = tomllib.load(fp)
^^^^^^^^^^^^^^^^
File "C:\Users\chen\AppData\Local\Programs\Python\Python312\Lib\tomllib\_parser.py", line 61, in load
s = b.decode()
^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte |
@machenme that is a different issue, make sure your encoding of |
Describe the bug
Python Version for venv
Python Version for installed
try to run subprocess
To reproduce
just run windows install command
Expected Behavior
it seems like msgpack's pyproject.toml error
Environment Information
nothing XD
Verbose Command Output
No response
Additional Context
No response
Are you willing to submit a PR to fix this bug?
The text was updated successfully, but these errors were encountered: