hearthsim / decrunch Goto Github PK
View Code? Open in Web Editor NEWPython wrapper around Crunch DXTc decompressor
Home Page: https://hearthsim.info
License: zlib License
Python wrapper around Crunch DXTc decompressor
Home Page: https://hearthsim.info
License: zlib License
The following error message is shown when I try to install pip install decrunch on my computer, even though I have Microsoft Visual C++ 14.0 installed.
pip install decrunch
Building wheel for decrunch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'f:\program files\python\python\python.exe' -u -c
'import sys, setuptools, tokenize; sys.argv[0] = '"''"C:\\Users\\Joong\\AppData\\Local\\Temp\\pip-
install-u1d4k562\\decrunch\\setup.py'"'"';
__file__ ='"'"'C:\\Users\\Joong\\AppData\\Local\\Temp\\pip-install-
u1d4k562\\decrunch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"',open)
(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');
f.close();exec;(compile(code,__file__, '"'"'exec'"'"')')' bdist_wheel -d
'C:\Users\Joong\AppData\Local\Temp\pip-wheel-oxss0ec4' --python-tag cp38
cwd: C:\Users\Joong\AppData\Local\Temp\pip-install-u1d4k562\decrunch\
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
building 'decrunch' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio":
https://visualstudio.microsoft.com/downloads/
---------------------------------------------------
ERROR: Failed building wheel for decrunch
The second part for Running setup.py clean for decrunch with the added:
... install --record 'C:\Users\Joong\AppData\Local\Temp\pip-record-vveqk67e\install-record.txt'
--single-version-externally managed --compile Check the logs for full command output.
I need some help please. I got the other dependencies installed all right without no problems, like pillow, lz4 and fsb5.
Was I meant to install the files in a certain order?
Unfortunately, the PyPi package contains a file named decrunch.cpp
.
he problem is that this file was generated with an old version of Cython which generates code incompatible with Python 3.7.
If I remove decrunch.cpp
, I can install the package as usual.
Maybe the solution is to just regenerate the file with a new Cython version.
To be precise, the error when installing is the following:
decrunch.cpp:3561:69: error: too many arguments to function
return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
^
error: command 'gcc' failed with exit status 1
Hi!
$ pip3 install decrunch || pip3 --version && python --version
Collecting decrunch
Installing collected packages: decrunch
Exception:
Traceback (most recent call last):
File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages\pip\wheel.py", line 347, in move_wheel_files
assert info_dir, "%s .dist-info directory not found" % req
AssertionError: decrunch .dist-info directory not found
pip 9.0.1 from c:\users\nicofisi\appdata\local\programs\python\python36\lib\site-packages (python 3.6)
Python 3.6.3
Windows 10 pro btw
What can I do? ❤️ Need it for your other tools
Was unable to install via pip on Windows 10 for Python 3.9, with the latest Visual Studio Build Tools 2019 installed. Was seeing:
pip cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
Ended up installing from source by commenting out the extra_compile_args=["-std=c++11"],
line from setup.py
From what I understand from googling around, seems that c++11 is enabled by default so the argument is unknown?
Could you try to use double quotes to includes malloc.h ?
#include "malloc.h"
Very low priority, but cubemaps are a thing in .crn files, and this API should handle that.
Building wheels for collected packages: decrunch
Building wheel for decrunch (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_ext
building 'decrunch' extension
creating build
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Icrunch -IC:\Users\X\AppData\Local\Programs\Python\Python310\include -IC:\Users\X\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include /EHsc /Tpcrn_decomp.cpp /Fobuild\temp.win-amd64-3.10\Release\crn_decomp.obj -std=c++11
cl : Befehlszeile warning D9002 : Unbekannte Option "-std=c++11" wird ignoriert.
crn_decomp.cpp
crn_decomp.cpp(3): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "string.h": No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for decrunch
Running setup.py clean for decrunch
Failed to build decrunch
Installing collected packages: decrunch
Running setup.py install for decrunch ... error
error: subprocess-exited-with-error
× Running setup.py install for decrunch did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running install
running build
running build_ext
building 'decrunch' extension
creating build
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Icrunch -IC:\Users\X\AppData\Local\Programs\Python\Python310\include -IC:\Users\X\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include /EHsc /Tpcrn_decomp.cpp /Fobuild\temp.win-amd64-3.10\Release\crn_decomp.obj -std=c++11
cl : Befehlszeile warning D9002 : Unbekannte Option "-std=c++11" wird ignoriert.
crn_decomp.cpp
crn_decomp.cpp(3): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "string.h": No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> decrunch
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
ERROR: Failed building wheel for decrunch
Atm decrunch doesn't support crunched versions of ETC2.
Addition to decrunch.pyx Format:
ETC1 = 10
ETC2 = 11
ETC2A = 12
ETC1S = 13
ETC2AS = 14
The /crunch code from Unity-Technologies/crunch results in a build error.
decrunch.cpp: In function ‘int __Pyx_modinit_type_init_code()’:
decrunch.cpp:3372:38: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
3372 | __pyx_type_8decrunch_UnpackContext.tp_print = 0;
System: Ubuntu 21.04 (GNU/Linux 5.11.0-16-generic x86_64)
sembiance@riverbend ~/decrunch $ python setup.py install --user
running install
running bdist_egg
running egg_info
creating decrunch.egg-info
writing decrunch.egg-info/PKG-INFO
writing top-level names to decrunch.egg-info/top_level.txt
writing dependency_links to decrunch.egg-info/dependency_links.txt
writing manifest file 'decrunch.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'decrunch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'decrunch' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-pc-linux-gnu-g++ -pthread -fPIC -Icrunch -I/usr/include/python2.7 -c crn_decomp.cpp -o build/temp.linux-x86_64-2.7/crn_decomp.o
In file included from crn_decomp.cpp:10:0:
crunch/crn_decomp.h: In function ‘void* crnd::crnd_malloc(size_t, size_t*)’:
crunch/crn_decomp.h:2536:28: error: cast from ‘crnd::uint8* {aka unsigned char*}’ to ‘crnd::uint32 {aka unsigned int}’ loses precision [-fpermissive]
CRND_ASSERT(((uint32)p_new & (CRND_MIN_ALLOC_ALIGNMENT - 1)) == 0);
^
crunch/crn_decomp.h:435:39: note: in definition of macro ‘CRND_ASSERT’
#define CRND_ASSERT(_exp) (void)( (!!(_exp)) || (crnd::crnd_assert(#_exp, __FILE__, __LINE__), 0) )
^
crunch/crn_decomp.h: In function ‘void* crnd::crnd_realloc(void*, size_t, size_t*, bool)’:
crunch/crn_decomp.h:2561:28: error: cast from ‘void*’ to ‘crnd::uint32 {aka unsigned int}’ loses precision [-fpermissive]
CRND_ASSERT(((uint32)p_new & (CRND_MIN_ALLOC_ALIGNMENT - 1)) == 0);
^
crunch/crn_decomp.h:435:39: note: in definition of macro ‘CRND_ASSERT’
#define CRND_ASSERT(_exp) (void)( (!!(_exp)) || (crnd::crnd_assert(#_exp, __FILE__, __LINE__), 0) )
^
error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1
>sembiance@riverbend ~/decrunch $ x86_64-pc-linux-gnu-g++ --version
x86_64-pc-linux-gnu-g++ (Gentoo 5.4.0-r3 p1.3, pie-0.6.5) 5.4.0
sembiance@riverbend ~/decrunch $ python --version
Python 2.7.13
sembiance@riverbend ~/decrunch $ uname -a
Linux riverbend 4.10.9 1 SMP PREEMPT Tue Apr 11 10:30:30 EDT 2017 x86_64 Intel(R) Core(TM) i7-4960X CPU @ 3.60GHz GenuineIntel GNU/Linux
It builds if I change the (uint32) cast to (long) (a temporary, unadvised cheat I learned from http://stackoverflow.com/questions/1640423/error-cast-from-void-to-int-loses-precision#1640448)
Note: Using Python 3.4 doesn't fix this error.
In file included from crn_decomp.cpp:18:
crunch/crn_decomp.h:345:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
^~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
The problem seems to be introduced in this commit: 6a21030#diff-99f7629e865e431d7ed8dd43d1f21ba5L345
Is it intentional?
@danielfrausto commented on Fri Feb 02 2018
Hi , while trying to install scrunch, I get the error "malloc.h replaced by stdlib.h" while installing. Using freebsd 11.1 and python3.
pip install decrunch
gives the following output (on Windows 10 1607 & Python 3.6.1):
Running setup.py (path:%USERPROFILE%\AppData\Local\Temp\pip-build-wxg4s8ak\decrunch\setup.py) egg_info for package decrunch produced metadata for project name unknown. Fix your #egg=decrunch fragments. Requirement already satisfied (use --upgrade to upgrade): unknown from https://pypi.python.org/packages/7b/0f/ea88026a5e2340eb45df1289e67c925e551158244728abdb7107d946f294/decrunch-0.2.1.tar.gz#md5=1e189a72d122fafc1717e6781c1567e2 in %USERPROFILE%\appdata\local\programs\python\python36-32\lib\site-packages
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.