Search code examples
python-3.xcx-freeze

Can't install cx_Freeze or scipy for Python 3.7 64-bit


I'm trying to install cx_Freeze and scipy but I get a

compile failed with error code 1

error every time. Here's what I see when I try to do it with cx_Freeze:

 error: file 'C:\Users\myAccount\AppData\Local\Temp\pip-install-nabp1tpo\cx-fre
eze\cxfreeze-postinstall' does not exist

    ----------------------------------------
Command "c:\users\myAccount\appdata\local\programs\python\python37\python.exe -u -
c "import setuptools, tokenize;__file__='C:\\Users\\myAccount\\AppData\\Local\\Tem
p\\pip-install-nabp1tpo\\cx-freeze\\setup.py';f=getattr(tokenize, 'open', open)(
__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __fil
e__, 'exec'))" install --record C:\Users\myAccount\AppData\Local\Temp\pip-record-3
6fbtmht\install-record.txt --single-version-externally-managed --compile" failed
 with error code 1 in C:\Users\myAccount\AppData\Local\Temp\pip-install-nabp1tpo\c
x-freeze\

How can I fix this?


Solution

  • You could manage to install it from wheel.

    First you need to install wheel:

    pip install wheel
    

    Then go to the following link to download the cx_Freeze wheel file according to you python version and windows version: https://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze

    For 64bit and Python 3.7: cx_Freeze‑5.1.1‑cp37‑cp37m‑win_amd64.whl

    On your command prompt change directory to the downloaded folder and use the command:

    pip install cx_Freeze‑5.1.1‑cp37‑cp37m‑win_amd64.whl 
    

    For further description on installing from wheel, check the following link: https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels

    The same method will solve your problem to install scipy.