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?
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.
It seems that this problem occurs because the version on PyPI isn't up to date. It works for me when I manually download it from the master branch on GitHub.
pip install --upgrade git+https://github.com/anthony-tuininga/cx_Freeze.git@master
Got this answer from issue #407 published on the GitHub page.
I tried Nischal's solution (which worked) but then ran into more errors down the line.
I then rolled back python to 3.6-32bit and everything worked flawlessly, just a heads up to whoever else gets this, unless you can get cx_freeze 6.0 installed it may be easier to rollback to python3.6 (or make a virtualenv of it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With