K0lb3 / UnityPy

UnityPy is python module that makes it possible to extract/unpack and edit Unity assets
MIT License
771 stars 114 forks source link

Fix your #egg=UnityPy fragments. #174

Closed michal-jar closed 1 year ago

michal-jar commented 1 year ago

Unable to install UnityPy using pip.

pip --version

pip 21.3.1 from /home/user/.local/lib/python3.6/site-packages/pip (python 3.6)

pip install UnityPy

Collecting UnityPy Downloading UnityPy-1.9.26.tar.gz (1.6 MB) |████████████████████████████████| 1.6 MB 1.1 MB/s
Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done WARNING: Generating metadata for package UnityPy produced metadata for project name unknown. Fix your #egg=UnityPy fragments. WARNING: Discarding https://files.pythonhosted.org/packages/84/7f/561b1dcc66e91cdd93ec511d70eb9958801b0086d945c51422fdc14d3461/UnityPy-1.9.26.tar.gz#sha256=8c57d545a4c28c3880b6e488f8e20406932b7772df96eb02c02046032d190371 (from https://pypi.org/simple/unitypy/) (requires-python:>=3.6). Requested unknown from https://files.pythonhosted.org/packages/84/7f/561b1dcc66e91cdd93ec511d70eb9958801b0086d945c51422fdc14d3461/UnityPy-1.9.26.tar.gz#sha256=8c57d545a4c28c3880b6e488f8e20406932b7772df96eb02c02046032d190371 has inconsistent name: filename has 'unitypy', but metadata has 'unknown' Downloading UnityPy-1.9.25.tar.gz (1.6 MB) |████████████████████████████████| 1.6 MB 16.6 MB/s
Installing build dependencies ... \^canceled ERROR: Operation cancelled by user

Also installation from source code does not work.

python -m pip install .

Processing /home/share/Dokumenty/workspace/UnityPy Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: UNKNOWN Building wheel for UNKNOWN (pyproject.toml) ... done Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-cp36-cp36m-linux_x86_64.whl size=1092733 sha256=14560fba760850c53194484fa51471dcf6ff424626777f1966c8d8d20c20ec8a Stored in directory: /tmp/pip-ephem-wheel-cache-2qbyrmid/wheels/2f/df/be/c9d6c260e86606200752b114965a01dc424f56fe2e5ae95464 Successfully built UNKNOWN Installing collected packages: UNKNOWN Successfully installed UNKNOWN-0.0.0

K0lb3 commented 1 year ago

I'm sorry, but I can't reproduce this behavior at all. All versions of UnityPy have to pass tests before being published, which includes an installation via pip.

Seeing that you use a pretty dated version of pip, upgrade it and try again.

If it still doesn't work, please share your python version, os, and CPU architecture (x64, x86, arm, ..).

michal-jar commented 1 year ago

This is the latest pip version that is available for python 3.6, any newer pip requires python 3.7. Maybe that is the issue that UnityPy does not support python 3.6 despite stating it does?

My machine with Intel CPU:

$python --version
Python 3.6.9

$pip --version
pip 21.3.1

$hostnamectl
  Operating System: Linux Mint 19.1
            Kernel: Linux 4.15.0-208-generic
      Architecture: x86-64
squaresmile commented 1 year ago

I think the problem comes from setuptools. pyproject.toml support was added to setuptools 61.0.0 but the latest version of setuptools that supports 3.6 is 59.6.0. Since there's only partial metadata in setup.py, setuptools couldn't find the package name and used UNKNOWN-0.0.0.

3.6 is also not tested in github actions. To support 3.6, all metadata probably would need to be moved to setup.py. Considering python 3.6 security support ended 1 year ago and ubuntu 18.04 will enter EOL soon, it's probably time to retire 3.6 support.

K0lb3 commented 1 year ago

I guess officially retiring 3.6 support is the most sound solution, as even just testing it isn't directly possible via github actions anymore.