weixin_39605414 2020-11-21 16:46
浏览 0

Unable to install PyGObject with Thonny Shell

Original report by Anonymous.

I was installing wordcloud from thonny on windows and the error occurred, then I found that download a prebuilt whl will help. But things become messier while I was trying to install PyGObject, there is no prebuilt whl for cp36 platform and the error message goes like this:


Collecting pygobject
  Using cached https://files.pythonhosted.org/packages/e0/e8/1e4f21800015a9ca153969e85fc29f7962f8f82fc5dbc1ecbdeb9dc54c75/PyGObject-3.28.3.tar.gz
Collecting pycairo>=1.11.1 (from pygobject)
  Using cached https://files.pythonhosted.org/packages/60/47/d335364f0ca00e475a40a5a664f17691bf77b3973f999b157d56ee89e04a/pycairo-1.17.0.tar.gz
Installing collected packages: pycairo, pygobject
  Running setup.py install for pycairo ... error
    Complete output from command c:\users\tester\.thonny\bundledpython36\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tester\\AppData\\Local\\Temp\\pip-install-l5zcx14a\\pycairo\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\tester\AppData\Local\Temp\pip-record-uu8f1zkt\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\tester\.thonny\bundledpython36\include\site\python3.6\pycairo:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.6
    creating build\lib.win32-3.6\cairo
    copying cairo\__init__.py -> build\lib.win32-3.6\cairo
    copying cairo\__init__.pyi -> build\lib.win32-3.6\cairo
    copying cairo\py.typed -> build\lib.win32-3.6\cairo
    running build_ext
    building 'cairo._cairo' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    ----------------------------------------
Command "c:\users\tester\.thonny\bundledpython36\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tester\\AppData\\Local\\Temp\\pip-install-l5zcx14a\\pycairo\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\tester\AppData\Local\Temp\pip-record-uu8f1zkt\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\tester\.thonny\bundledpython36\include\site\python3.6\pycairo" failed with error code 1 in C:\Users\tester\AppData\Local\Temp\pip-install-l5zcx14a\pycairo\

I really need some help facing this problem.

该提问来源于开源项目:thonny/thonny

  • 写回答

5条回答 默认 最新

  • weixin_39605414 2020-11-21 16:46
    关注

    Building native packages in Windows can be a headache, even if you have C++ compiler present.

    I would try getting this module via Anaconda (https://anaconda.org/conda-forge/pygobject), ie. you should install Anaconda Python distribution, use its conda tool to install pygobject and finally let Thonny use Anaconda Python as backend (Tools => Options => Interpreter (or Backend in 2.2))

    评论

报告相同问题?