Skip to content
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

rcssmin and rjsmin do not install #807

Closed
bobort opened this issue Nov 2, 2016 · 23 comments
Closed

rcssmin and rjsmin do not install #807

bobort opened this issue Nov 2, 2016 · 23 comments

Comments

@bobort
Copy link

bobort commented Nov 2, 2016

I am installing django-compressor on Windows 10 x64 with Python 3.4 x64. I get the following error when I install it with pip. Interestingly enough, I did not get such an error with Python 3.5 x64.

>  pip install django-compressor --upgrade
Collecting django-compressor
  Using cached django_compressor-2.1-py2.py3-none-any.whl
Collecting rjsmin==1.0.12 (from django-compressor)
  Using cached rjsmin-1.0.12.tar.gz
Collecting rcssmin==1.0.6 (from django-compressor)
  Using cached rcssmin-1.0.6.tar.gz
Requirement already up-to-date: django-appconf>=1.0 in d:\env3\lib\site-packages (from django-compressor)
Building wheels for collected packages: rjsmin, rcssmin
  Running setup.py bdist_wheel for rjsmin ... error
  Complete output from command d:\env\scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\Temp\\pip-build-um3ph8qp\\rjsmin\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d \Temp\tmp6dj8tx90pip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.4
  copying .\rjsmin.py -> build\lib.win-amd64-3.4
  running build_ext
  building '_rjsmin' extension
  error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

  ----------------------------------------
  Failed building wheel for rjsmin
  Running setup.py clean for rjsmin
  Running setup.py bdist_wheel for rcssmin ... error
  Complete output from command d:\env3\scriptspython.exe -u -c "import setuptools, tokenize;__file__='\\Temp\\pip-build-um3ph8qp\\rcssmin\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d \Temp\tmp_cfj9vrjpip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.4
  copying .\rcssmin.py -> build\lib.win-amd64-3.4
  running build_ext
  building '_rcssmin' extension
  error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

  ----------------------------------------
  Failed building wheel for rcssmin
  Running setup.py clean for rcssmin
Failed to build rjsmin rcssmin
Installing collected packages: rjsmin, rcssmin, django-compressor
  Running setup.py install for rjsmin ... error
    Complete output from command d:\env3\scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\Temp\\pip-build-um3ph8qp\\rjsmin\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record \Temp\pip-_z23ysr6-record\install-record.txt --single-version-externally-managed --compile --install-headers d:\env3\include\site\python3.4\rjsmin:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.4
    copying .\rjsmin.py -> build\lib.win-amd64-3.4
    running build_ext
    building '_rjsmin' extension
    error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

    ----------------------------------------
Command "d:\env3\scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\Temp\\pip-build-um3ph8qp\\rjsmin\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record \Temp\pip-_z23ysr6-record\install-record.txt --single-version-externally-managed --compile --install-headers d:\env3\include\site\python3.4\rjsmin" failed with error code 1 in \Temp\pip-build-um3ph8qp\rjsmin\

@bobort
Copy link
Author

bobort commented Nov 2, 2016

I was able to get it to install by doing this first:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
pip install django-compressor --upgrade

As mentioned in comments below, in Ubuntu, you need to install python3-dev. If you are using the deadsnakes repository, you can use, i.e. sudo apt-get install python3.9-dev.

@karyon
Copy link
Contributor

karyon commented Nov 2, 2016

that sounds about right. they have some c code they try to compile, but there was no compiler installed on your system. they could provide a better error message, see here: ndparker/rcssmin#4

we could theoretically make rcssmin and rjsmin non-mandatory (also discussed here #803), but i think it's nice to have some installed by default. if you think otherwise, you can open a ticket for that if you want.

@karyon karyon closed this as completed Nov 2, 2016
@arita37
Copy link

arita37 commented May 4, 2017

Was very useful.

@okjodom
Copy link

okjodom commented May 19, 2017

Same issue trying to install in linux mint 18.

_setup/include/cext.h:34:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

@karyon how does installing without the c extensions affect the functionality?

@karyon
Copy link
Contributor

karyon commented May 19, 2017

@JoDoM rcssmin's readme says rcssmin.c is a reimplementation of rcssmin.py in C and improves runtime up to factor 100 or so, so i guess the features are the same, but it works much slower without the c extensions.

@okjodom
Copy link

okjodom commented May 19, 2017

oh great, I've managed to install it following your tip above. Should I have any issues then ill try to reinstall it with the c extensions. This is considering that previously I had it installing just fine in a different mint 18 VM

@demeralde
Copy link

Installing python3.6-dev fixed it for me. I'm using Python 3.6, so substitute the version number with whatever version of Python you're using.

@saczuac
Copy link

saczuac commented Apr 25, 2018

The real solution is installing python3-dev package. After sudo apt-get install python3-dev i was able to get it. Cheers

@factorlive
Copy link

Thanks, MacOS High Sierra excl. Xcode spam and with miniconda & python3.6 showed the same error.

@Qoyyuum
Copy link

Qoyyuum commented Sep 7, 2018

I have tried the following and it works:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"

@k-funk
Copy link

k-funk commented Sep 30, 2018

For me, I was missing xcode command line tools on 10.13 (thought it was installed, but guess not). I was able to fix the OP's issue that I also had by running xcode-select --install

@aquarii11
Copy link

I was able to get it to install by doing this first:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
pip install django-compressor --upgrade

I was able to get it to install by doing this first:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
pip install django-compressor --upgrade

@aquarii11
Copy link

Super bob...

@Fabricourt
Copy link

Hurray it worked ....thanks

@coler-j
Copy link

coler-j commented Apr 18, 2019

rjsmin the install-option="--without-c-extensions" is no longer required.

It looks like the install option for rjsmin may have been removed in the new 1.1.0 release released March 6th 2019.

Closed issue on rjsmin repo: ndparker/rjsmin#15

@karyon
Copy link
Contributor

karyon commented Apr 19, 2019

see #930

@brmley
Copy link

brmley commented Jun 9, 2019

I have tried the following and it works:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"

New rjsmin doesn't work with that option at the moment
error:
error: option --without-c-extensions not recognized
If you have that problem you can set the version:
pip install rjsmin==1.0.12 --install-option="--without-c-extensions"

@karyon
Copy link
Contributor

karyon commented Jun 11, 2019

@brmley as stated above, you should be able to simply leave out that option now, no need to install an older version.

@octavioamu
Copy link

Last commands working for me:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin 
pip install django-compressor --upgrade

@uhurusurfa
Copy link

apt-get install python3.7-dev - seems to be a dependency on this library and solved my issue

@devbtc
Copy link

devbtc commented Jul 9, 2021

facing an error on windows machine. implemented same thing there. but still not working

@vtmh
Copy link

vtmh commented Oct 27, 2021

Why not just install build-essential package so gcc is in the container or system you need it in? This is what I did to fix this as the error states it is a compilation issue.

apt install build-essential -y

@bobort
Copy link
Author

bobort commented Oct 27, 2021

@vtmh Because we're using Windows...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests