Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 679
Cole Avatar asked Jun 04 '18 17:06

Cole


3 Answers

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.

like image 171
Nischal J Thapa Avatar answered Nov 11 '22 16:11

Nischal J Thapa


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.

like image 28
LukeDev Avatar answered Nov 11 '22 17:11

LukeDev


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).

like image 21
Jerome Paddick Avatar answered Nov 11 '22 18:11

Jerome Paddick