pygobject / pycairo

Python bindings for cairo
https://pycairo.readthedocs.io
Other
623 stars 85 forks source link

pip install pycairo faill #212

Open project2501a opened 4 years ago

project2501a commented 4 years ago

Hello On windows 10 - python 3.8

Building wheels for collected packages: pycairo
  Building wheel for pycairo (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\$user\appdata\local\programs\python\python38\python.exe' 'c:\users\$user\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\$user\AppData\Local\Temp\tmpvuthyety'
       cwd: C:\Users\$user\AppData\Local\Temp\pip-req-build-kp_n1bbz
  Complete output (18 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\cairo
  copying cairo\__init__.py -> build\lib.win-amd64-3.8\cairo
  copying cairo\__init__.pyi -> build\lib.win-amd64-3.8\cairo
  copying cairo\py.typed -> build\lib.win-amd64-3.8\cairo
  running build_ext
  building 'cairo._cairo' extension
  creating build\temp.win-amd64-3.8
  creating build\temp.win-amd64-3.8\Release
  creating build\temp.win-amd64-3.8\Release\cairo
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=20 -DPYCAIRO_VERSION_MICRO=1 -Ic:\users\$user\appdata\local\programs\python\python38\include -Ic:\users\$user\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tccairo/device.c /Fobuild\temp.win-amd64-3.8\Release\cairo/device.obj
  device.c
  C:\Users\$user\AppData\Local\Temp\pip-req-build-kp_n1bbz\cairo\pycairo.h(37): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'cairo.h'ÿ: No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for pycairo
Failed to build pycairo
ERROR: Could not build wheels for pycairo which use PEP 517 and cannot be installed directly
lazka commented 4 years ago

How do you run pip to get to this error?

project2501a commented 4 years ago

on Python 3.8.5 and same on Python 3.9.0 pip install pycairo

same result for PyGObject pip install PyGObject

same final error

ERROR: Could not build wheels for ...... which use PEP 517 and cannot be installed dire..............

naveen521kk commented 4 years ago

I remember we created wheels for windows?

lazka commented 4 years ago

yes, I don't know why they aren't used here.. they get used on my machine.

naveen521kk commented 4 years ago

for me also. also on many other systems which uses manim.

naveen521kk commented 4 years ago

@project2501a Can you try the below command?

pip3.8 install https://files.pythonhosted.org/packages/01/94/b16f92f4aac89739cb31243bcf4346d2c5ef468db982804ff378e9712589/pycairo-1.20.0-cp38-cp38-win_amd64.whl

I really don't know why your computer's pip uses wheels maybe it's configured to not use wheel? What this does it pulls wheel from PyPi and install(the way it should do usually).

project2501a commented 4 years ago

@naveen521kk hello , returns already installed, i uninstalled it and used your command, it went fine, weird

python has just been installed, from the installer

amiltonwong commented 3 years ago

Hi, @naveen521kk ,

I got the similar error in my Ubuntu 16.04 system

Pip subprocess error:
  ERROR: Command errored out with exit status 1:
   command: /root/anaconda3/envs/pytorch-gat/bin/python /root/anaconda3/envs/pytorch-gat/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp1xff5oe8
       cwd: /tmp/pip-install-kkpb3rbl/pycairo_24f3dd5c18ec42d9854417db277fda61
  Complete output (15 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/cairo
  copying cairo/__init__.py -> build/lib.linux-x86_64-3.8/cairo
  copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.8/cairo
  copying cairo/py.typed -> build/lib.linux-x86_64-3.8/cairo
  running build_ext
  Package cairo was not found in the pkg-config search path.
  Perhaps you should add the directory containing `cairo.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'cairo' found
  Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for pycairo
ERROR: Could not build wheels for pycairo which use PEP 517 and cannot be installed directly

Any hints to solve it? (like the link you provided? )

naveen521kk commented 3 years ago

Hi @amiltonwong There are no wheels for pycairo outside of windows sadly. So you would have to compile from source, the above error message says it couldn't find cairo, which can be installed from your package manager. See documentation for more information.

kubapok commented 3 years ago

Hi @amiltonwong There are no wheels for pycairo outside of windows sadly. So you would have to compile from source, the above error message says it couldn't find cairo, which can be installed from your package manager. See documentation for more information.

Yes, I think @naveen521kk is right. I had a similar pep517 error message using pip. After I installed cairo ( https://pycairo.readthedocs.io/en/latest/getting_started.html ) pip installed pycairo succesfuly.