8

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?

jpeg
  • 2,372
  • 4
  • 18
  • 31
Cole
  • 183
  • 2
  • 5
  • 13

5 Answers5

17

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.

jpeg
  • 2,372
  • 4
  • 18
  • 31
Nischal J Thapa
  • 186
  • 1
  • 3
  • I am getting this error: Could not find a version that satisfies the requirement cx_Freeze-5.1.1-cp37-cp37m-win_amd64 (from versions: ) No matching distribution found for cx_Freeze-5.1.1-cp37-cp37m-win_amd64 – Kunj Mehta Mar 03 '19 at 13:31
  • cx_Freeze‑5.1.1‑cp37‑cp37m‑win_amd64.whl is not available anymore on this site. – Harper Oct 17 '19 at 07:30
3

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.

LukeDev
  • 509
  • 4
  • 19
  • 1
    You can swap out ...@master with ...@5.1.1 for example, to install a specific version (e.g. Tag) – Harper Oct 18 '19 at 08:25
2

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

Jerome Paddick
  • 399
  • 1
  • 14
  • 2
    cx_Freeze has currently a bug with Python 3.7. Until a corrected version of cx_Freeze is issued, you could also manually patch your local cx_Freeze package as described in https://stackoverflow.com/q/51314105/8516269 instead of rolling back to Python 3.6. – jpeg Sep 03 '18 at 06:35
0

I downloaded 32 bit installer when 64 bit didn't work.

pip install cx_Freeze-5.1.1-cp37-cp37m-win32.whl

This works fine for me. So I guess no need to downgrade to Python 3.6

Archie25
  • 11
  • 2
-1

I am using Python 3.7 (64-bit)

  1. Download cx_Freeze here (depending on your Python version):

  2. And paste this .whl file in working directory.

  3. Open command prompt, paste following command and press enter:

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

Please note that this command is for Python 3.7(64-bit)

  1. Output should look like:

Processing c:\users\Python37\cx_freeze-5.1.1-cp37-cp37m-win_amd64.whl*

Installing collected packages: cx-Freeze*

Successfully installed cx-Freeze-5.1.1*

Community
  • 1
  • 1
  • Which new information which is not already contained in [Nischal's answer](https://stackoverflow.com/a/50717003/8516269) does your answer bring? – jpeg Jun 05 '19 at 11:41