fract4d / gnofract4d

A fractal generation program for linux
Other
116 stars 27 forks source link

Can't install gnofract4d on Windows #227

Open Estrangeling opened 3 years ago

Estrangeling commented 3 years ago
C:\Windows\System32> pip install https://github.com/fract4d/gnofract4d/releases/download/v4.3/gnofract4d-4.3.tar.gz
Collecting https://github.com/fract4d/gnofract4d/releases/download/v4.3/gnofract4d-4.3.tar.gz
  Downloading https://github.com/fract4d/gnofract4d/releases/download/v4.3/gnofract4d-4.3.tar.gz (886 kB)
     |████████████████████████████████| 886 kB 136 kB/s
    ERROR: Command errored out with exit status 1:
     command: 'c:\program files\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Estranger\\AppData\\Local\\Temp\\pip-req-build-a876zudl\\setup.py'"'"'; __file__='"'"'C:\\Users\\Estranger\\AppData\\Local\\Temp\\pip-req-build-a876zudl\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Estranger\AppData\Local\Temp\pip-pip-egg-info-ym_x7l0s'
         cwd: C:\Users\Estranger\AppData\Local\Temp\pip-req-build-a876zudl\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Estranger\AppData\Local\Temp\pip-req-build-a876zudl\setup.py", line 27, in <module>
        os.environ["CFLAGS"] = sysconfig.get_config_var(
    AttributeError: 'NoneType' object has no attribute 'replace'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\program files\python39\python.exe -m pip install --upgrade pip' command.

I am using Python 3.9.1 amd64 on Windows 10 20H2, I am not very experienced in Python however I am very experienced in PowerShell 7, I was able to diagnose the cause of the issue myself, the traceback said line 27 caused the error, line 27 gets the value of CFLAGS variable using get_config_var method of sysconfig type, the value is a string, it deletes "-Wstrict-prototypes" substring and assigns the result value to os.environ["CFLAGS"].

As a quick diagnosis, I opened Python, and run:

import sysconfig
sysconfig.get_config_var("CFLAGS")
sysconfig.get_config_var("OPT")

They returned nothing, meaning the variables don't exist. I deleted lines 24 to 30, this is solved, however it then says:

Unable to check for 'libpng', pkg-config not installed

I tried to run pip install libpng and pkg-config, but no matching distribution found...

mindhells commented 3 years ago

I'm afraid Gnofract 4D only works on Unix-based systems

cjmayo commented 2 years ago

It's not native, but Gnofract 4D will run on Windows 11 with Windows Subsystem for Linux WSLg Preview.

After installing Ubuntu from the Microsoft Store (and if using pip for Gnofract 4D installation: sudo apt install python3-pip) can then follow the Ubuntu instructions in README.md.

If pip was used, gnofract4d will be installed in ~/.local/bin/. If ~/.local/bin didn't already exist it won't be in PATH until the next time WSL is started.

No entry is added to the Windows Start menu, because ~/.local/share/applications is not scanned for .desktop files, but you can create your own shortcut with the target: wsl ~ -d Ubuntu -- ~/.local/bin/gnofract4d

cjmayo commented 1 year ago

Now you only need WSL from the Microsoft Store on both Windows 10 and Windows 11.