Issues in installing pygobject in MacOS - python

I am trying to install pygobject using pip, even with brew in MacOS, but now successful. I followed guides.
If I use the official installation guide in https://pygobject.readthedocs.io/en/latest/getting_started.html, then I have gtk+3 installed, but when I try to import the library:
python3 -c 'import gi; gi.require_version("Gtk", "3.0"); print("ok")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
This is the output of the installation after using pip3:
(base) khalil presentation (master) >> pip3 install gobject pygobject
Collecting gobject
Downloading gobject-0.1.0-py3-none-any.whl (5.9 kB)
Collecting pygobject
Using cached PyGObject-3.42.1.tar.gz (718 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pycairo>=1.16.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pygobject) (1.20.1)
Building wheels for collected packages: pygobject
Building wheel for pygobject (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/tmpsnfmi_oc
cwd: /private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-install-2saq002f/pygobject_1efb85aba31e4700a39a2c6c52381a62
Complete output (90 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/pygtkcompat
copying pygtkcompat/pygtkcompat.py -> build/lib.macosx-10.9-x86_64-3.6/pygtkcompat
copying pygtkcompat/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/pygtkcompat
copying pygtkcompat/generictreemodel.py -> build/lib.macosx-10.9-x86_64-3.6/pygtkcompat
creating build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/_signalhelper.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/_constants.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/pygtkcompat.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/_ossighelper.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/importer.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/_error.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/_gtktemplate.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/_propertyhelper.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/types.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/docstring.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/_option.py -> build/lib.macosx-10.9-x86_64-3.6/gi
copying gi/module.py -> build/lib.macosx-10.9-x86_64-3.6/gi
creating build/lib.macosx-10.9-x86_64-3.6/gi/repository
copying gi/repository/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/gi/repository
creating build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/GIMarshallingTests.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/Gdk.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/Pango.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/GdkPixbuf.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/Gtk.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/GLib.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/GObject.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/Gio.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
copying gi/overrides/keysyms.py -> build/lib.macosx-10.9-x86_64-3.6/gi/overrides
running build_ext
pycairo: new API
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 262, in build_wheel
metadata_directory)
File "/private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-build-env-8drx7d57/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 231, in build_wheel
wheel_directory, config_settings)
File "/private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-build-env-8drx7d57/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-build-env-8drx7d57/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 268, in run_setup
self).run_setup(setup_script=setup_script)
File "/private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-build-env-8drx7d57/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 1259, in <module>
main()
File "setup.py", line 1254, in main
zip_safe=False,
File "/private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-build-env-8drx7d57/overlay/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-build-env-8drx7d57/overlay/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 1088, in run
self._setup_extensions()
File "setup.py", line 1083, in _setup_extensions
add_pycairo(gi_cairo_ext)
File "setup.py", line 1066, in add_pycairo
ext.include_dirs += [get_pycairo_include_dir()]
File "setup.py", line 893, in get_pycairo_include_dir
include_dir = find_path(find_new_api())
File "setup.py", line 848, in find_new_api
import cairo
File "/private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-build-env-8drx7d57/overlay/lib/python3.6/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: dlopen(/private/var/folders/t0/_kkpxc35687gknp4d99b9lbr0000gn/T/pip-build-env-8drx7d57/overlay/lib/python3.6/site-packages/cairo/_cairo.cpython-36m-darwin.so, 0x0002): symbol not found in flat namespace '_cairo_append_path'
----------------------------------------
ERROR: Failed building wheel for pygobject
Failed to build pygobject
ERROR: Could not build wheels for pygobject, which is required to install pyproject.toml-based projects
(base) khalil presentation (master) >> ```

Problem solved! Thanks to #rasjani
First, I upgraded to the latest version of python, then I create a new_env using conda:
conda create --name new_env python=3.9.12
conda activate new_env
conda install -c conda-forge pygobject
Solution from: Github

Related

ModuleNotFoundError: No module named 'gi'. Can't get PyGObject installed

I've been trying to solve this issue for about a week or two now, still haven't found a solution. I'm on Arch Linux. Here's what I've tried so far:
installed python-gobject and gobject-introspection through pacman
installed pycairo through python
Tried installing PyGObject through python, but it's throwing an error
tried pip install PyGObject --no-use-pep517
pip install --upgrade wheel
Reset $PATH variable
I do have Anaconda installed, which has been mentioned in other forums with similar issues, but haven't figured out what the problem could be regarding conda.
The main problem is I can't get PyGObject installed.
Here's the output for the program I'm trying to run:
$ ./lutris
Traceback (most recent call last):
File "/home/greyside/git/lutris/bin/./lutris", line 52, in <module>
from lutris.gui.application import Application # pylint: disable=no-name-in-module
File "/home/greyside/git/lutris/lutris/gui/application.py", line 28, in <module>
import gi
ModuleNotFoundError: No module named 'gi'
Here's the output for pip install PyGObject:
$ pip install PyGObject
Collecting PyGObject
Using cached PyGObject-3.42.0.tar.gz (716 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: pycairo>=1.16.0 in /home/greyside/anaconda3/lib/python3.9/site-packages (from PyGObject) (1.21.0)
Building wheels for collected packages: PyGObject
Building wheel for PyGObject (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /home/greyside/anaconda3/bin/python /home/greyside/anaconda3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpn15zx71v
cwd: /tmp/pip-install-s12pfc6q/pygobject_15ec34742d654e599404ba75c60a660e
Complete output (98 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-3.9/pygtkcompat
creating build/lib.linux-x86_64-3.9/gi
copying gi/types.py -> build/lib.linux-x86_64-3.9/gi
copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.9/gi
copying gi/module.py -> build/lib.linux-x86_64-3.9/gi
copying gi/importer.py -> build/lib.linux-x86_64-3.9/gi
copying gi/docstring.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_option.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_gtktemplate.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_error.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_constants.py -> build/lib.linux-x86_64-3.9/gi
copying gi/__init__.py -> build/lib.linux-x86_64-3.9/gi
creating build/lib.linux-x86_64-3.9/gi/repository
copying gi/repository/__init__.py -> build/lib.linux-x86_64-3.9/gi/repository
creating build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/__init__.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GdkPixbuf.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.9/gi/overrides
running build_ext
pycairo: new API
Traceback (most recent call last):
File "/home/greyside/anaconda3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
main()
File "/home/greyside/anaconda3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/greyside/anaconda3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 248, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 244, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 229, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 281, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 1259, in <module>
main()
File "setup.py", line 1219, in main
setup(
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "setup.py", line 1088, in run
self._setup_extensions()
File "setup.py", line 1083, in _setup_extensions
add_pycairo(gi_cairo_ext)
File "setup.py", line 1066, in add_pycairo
ext.include_dirs += [get_pycairo_include_dir()]
File "setup.py", line 893, in get_pycairo_include_dir
include_dir = find_path(find_new_api())
File "setup.py", line 848, in find_new_api
import cairo
File "/tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: /tmp/pip-build-env-4lzlmpry/overlay/lib/python3.9/site-packages/cairo/_cairo.cpython-39-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
----------------------------------------
ERROR: Failed building wheel for PyGObject
Failed to build PyGObject
ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly
And here's the output for pip install PyGObject --no-use-pep517:
pip install PyGObject --no-use-pep517
Collecting PyGObject
Using cached PyGObject-3.42.0.tar.gz (716 kB)
Requirement already satisfied: pycairo>=1.16.0 in /home/greyside/anaconda3/lib/python3.9/site-packages (from PyGObject) (1.21.0)
Building wheels for collected packages: PyGObject
Building wheel for PyGObject (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/greyside/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-72srifkn
cwd: /tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/
Complete output (85 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-3.9/pygtkcompat
creating build/lib.linux-x86_64-3.9/gi
copying gi/types.py -> build/lib.linux-x86_64-3.9/gi
copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.9/gi
copying gi/module.py -> build/lib.linux-x86_64-3.9/gi
copying gi/importer.py -> build/lib.linux-x86_64-3.9/gi
copying gi/docstring.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_option.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_gtktemplate.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_error.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_constants.py -> build/lib.linux-x86_64-3.9/gi
copying gi/__init__.py -> build/lib.linux-x86_64-3.9/gi
creating build/lib.linux-x86_64-3.9/gi/repository
copying gi/repository/__init__.py -> build/lib.linux-x86_64-3.9/gi/repository
creating build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/__init__.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GdkPixbuf.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.9/gi/overrides
running build_ext
pycairo: new API
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1259, in <module>
main()
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1219, in main
setup(
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/home/greyside/anaconda3/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1088, in run
self._setup_extensions()
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1083, in _setup_extensions
add_pycairo(gi_cairo_ext)
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1066, in add_pycairo
ext.include_dirs += [get_pycairo_include_dir()]
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 893, in get_pycairo_include_dir
include_dir = find_path(find_new_api())
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 848, in find_new_api
import cairo
File "/home/greyside/anaconda3/lib/python3.9/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: /home/greyside/anaconda3/lib/python3.9/site-packages/cairo/_cairo.cpython-39-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
----------------------------------------
ERROR: Failed building wheel for PyGObject
Running setup.py clean for PyGObject
Failed to build PyGObject
Installing collected packages: PyGObject
Running setup.py install for PyGObject ... error
ERROR: Command errored out with exit status 1:
command: /home/greyside/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0v4b5sk8/install-record.txt --single-version-externally-managed --compile --install-headers /home/greyside/anaconda3/include/python3.9/PyGObject
cwd: /tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/
Complete output (89 lines):
running install
/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.9/pygtkcompat
copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-3.9/pygtkcompat
creating build/lib.linux-x86_64-3.9/gi
copying gi/types.py -> build/lib.linux-x86_64-3.9/gi
copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.9/gi
copying gi/module.py -> build/lib.linux-x86_64-3.9/gi
copying gi/importer.py -> build/lib.linux-x86_64-3.9/gi
copying gi/docstring.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_option.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_gtktemplate.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_error.py -> build/lib.linux-x86_64-3.9/gi
copying gi/_constants.py -> build/lib.linux-x86_64-3.9/gi
copying gi/__init__.py -> build/lib.linux-x86_64-3.9/gi
creating build/lib.linux-x86_64-3.9/gi/repository
copying gi/repository/__init__.py -> build/lib.linux-x86_64-3.9/gi/repository
creating build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/__init__.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GdkPixbuf.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.9/gi/overrides
copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.9/gi/overrides
running build_ext
pycairo: new API
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1259, in <module>
main()
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1219, in main
setup(
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/command/install.py", line 670, in run
self.run_command('build')
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1214, in run_command
super().run_command(command)
File "/home/greyside/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1088, in run
self._setup_extensions()
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1083, in _setup_extensions
add_pycairo(gi_cairo_ext)
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 1066, in add_pycairo
ext.include_dirs += [get_pycairo_include_dir()]
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 893, in get_pycairo_include_dir
include_dir = find_path(find_new_api())
File "/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py", line 848, in find_new_api
import cairo
File "/home/greyside/anaconda3/lib/python3.9/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: /home/greyside/anaconda3/lib/python3.9/site-packages/cairo/_cairo.cpython-39-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
----------------------------------------
ERROR: Command errored out with exit status 1: /home/greyside/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yujdqs8g/pygobject_33b98e7ae1f94d9ea4537c84d96133cb/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0v4b5sk8/install-record.txt --single-version-externally-managed --compile --install-headers /home/greyside/anaconda3/include/python3.9/PyGObject Check the logs for full command output.

PIP error : cannot build wheels for sip, which is required to install pyproject.toml-based projects

Whenever I try to install sip with pip, it shows an error. The full output was :
Defaulting to user installation because normal site-packages is not writeable
Collecting sip
Using cached sip-6.5.0.tar.gz (1.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: toml in c:\users\Admin\appdata\roaming\python\pyt
hon310-32\site-packages (from sip) (0.10.2)
Requirement already satisfied: setuptools in c:\program files\python310-32\lib\s
ite-packages (from sip) (57.4.0)
Requirement already satisfied: packaging in c:\users\Admin\appdata\roaming\pytho
n\python310-32\site-packages (from sip) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\Admin\appdat
a\roaming\python\python310-32\site-packages (from packaging->sip) (3.0.6)
Building wheels for collected packages: sip
It was running perfectly. But;
Building wheel for sip (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files\Python310-32\python.exe' 'C:\Users\Admin\AppData\R
oaming\Python\Python310-32\site-packages\pip\_vendor\pep517\in_process\_in_proce
ss.py' build_wheel 'C:\Users\Admin\AppData\Local\Temp\tmpbp29upup'
cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-z5zff4sm\sip_b8fe66d11
90b4a5bb4ab29314f68ed38
Complete output (147 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.10
creating build\lib.win32-3.10\sipbuild
copying sipbuild\abstract_builder.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\abstract_project.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\api.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\argument_parser.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\bindings.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\buildable.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\builder.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\configurable.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\distutils_builder.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\exceptions.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\helpers.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\installable.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\project.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\pyproject.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\py_versions.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\setuptools_builder.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\version.py -> build\lib.win32-3.10\sipbuild
copying sipbuild\__init__.py -> build\lib.win32-3.10\sipbuild
creating build\lib.win32-3.10\sipbuild\distinfo
copying sipbuild\distinfo\distinfo.py -> build\lib.win32-3.10\sipbuild\distinf
o
copying sipbuild\distinfo\main.py -> build\lib.win32-3.10\sipbuild\distinfo
copying sipbuild\distinfo\__init__.py -> build\lib.win32-3.10\sipbuild\distinf
o
creating build\lib.win32-3.10\sipbuild\module
copying sipbuild\module\abi_version.py -> build\lib.win32-3.10\sipbuild\module
copying sipbuild\module\main.py -> build\lib.win32-3.10\sipbuild\module
copying sipbuild\module\module.py -> build\lib.win32-3.10\sipbuild\module
copying sipbuild\module\__init__.py -> build\lib.win32-3.10\sipbuild\module
creating build\lib.win32-3.10\sipbuild\tools
copying sipbuild\tools\build.py -> build\lib.win32-3.10\sipbuild\tools
copying sipbuild\tools\install.py -> build\lib.win32-3.10\sipbuild\tools
copying sipbuild\tools\sdist.py -> build\lib.win32-3.10\sipbuild\tools
copying sipbuild\tools\wheel.py -> build\lib.win32-3.10\sipbuild\tools
copying sipbuild\tools\__init__.py -> build\lib.win32-3.10\sipbuild\tools
creating build\lib.win32-3.10\sipbuild\module\source
creating build\lib.win32-3.10\sipbuild\module\source\12
copying sipbuild\module\source\12\apiversions.c -> build\lib.win32-3.10\sipbui
ld\module\source\12
copying sipbuild\module\source\12\array.c -> build\lib.win32-3.10\sipbuild\mod
ule\source\12
copying sipbuild\module\source\12\array.h -> build\lib.win32-3.10\sipbuild\mod
ule\source\12
copying sipbuild\module\source\12\bool.cpp -> build\lib.win32-3.10\sipbuild\mo
dule\source\12
copying sipbuild\module\source\12\descriptors.c -> build\lib.win32-3.10\sipbui
ld\module\source\12
copying sipbuild\module\source\12\int_convertors.c -> build\lib.win32-3.10\sip
build\module\source\12
copying sipbuild\module\source\12\LICENSE -> build\lib.win32-3.10\sipbuild\mod
ule\source\12
copying sipbuild\module\source\12\LICENSE-GPL2 -> build\lib.win32-3.10\sipbuil
d\module\source\12
copying sipbuild\module\source\12\LICENSE-GPL3 -> build\lib.win32-3.10\sipbuil
d\module\source\12
copying sipbuild\module\source\12\MANIFEST.in -> build\lib.win32-3.10\sipbuild
\module\source\12
copying sipbuild\module\source\12\objmap.c -> build\lib.win32-3.10\sipbuild\mo
dule\source\12
copying sipbuild\module\source\12\pyproject.toml -> build\lib.win32-3.10\sipbu
ild\module\source\12
copying sipbuild\module\source\12\qtlib.c -> build\lib.win32-3.10\sipbuild\mod
ule\source\12
copying sipbuild\module\source\12\README.in -> build\lib.win32-3.10\sipbuild\m
odule\source\12
copying sipbuild\module\source\12\setup.cfg.in -> build\lib.win32-3.10\sipbuil
d\module\source\12
copying sipbuild\module\source\12\setup.py.in -> build\lib.win32-3.10\sipbuild
\module\source\12
copying sipbuild\module\source\12\sip.h.in -> build\lib.win32-3.10\sipbuild\mo
dule\source\12
copying sipbuild\module\source\12\sip.pyi -> build\lib.win32-3.10\sipbuild\mod
ule\source\12
copying sipbuild\module\source\12\sip.rst.in -> build\lib.win32-3.10\sipbuild\
module\source\12
copying sipbuild\module\source\12\sipint.h -> build\lib.win32-3.10\sipbuild\mo
dule\source\12
copying sipbuild\module\source\12\siplib.c -> build\lib.win32-3.10\sipbuild\mo
dule\source\12
copying sipbuild\module\source\12\threads.c -> build\lib.win32-3.10\sipbuild\m
odule\source\12
copying sipbuild\module\source\12\voidptr.c -> build\lib.win32-3.10\sipbuild\m
odule\source\12
creating build\lib.win32-3.10\sipbuild\module\source\13
copying sipbuild\module\source\13\array.c -> build\lib.win32-3.10\sipbuild\mod
ule\source\13
copying sipbuild\module\source\13\array.h -> build\lib.win32-3.10\sipbuild\mod
ule\source\13
copying sipbuild\module\source\13\bool.cpp -> build\lib.win32-3.10\sipbuild\mo
dule\source\13
copying sipbuild\module\source\13\descriptors.c -> build\lib.win32-3.10\sipbui
ld\module\source\13
copying sipbuild\module\source\13\int_convertors.c -> build\lib.win32-3.10\sip
build\module\source\13
copying sipbuild\module\source\13\LICENSE -> build\lib.win32-3.10\sipbuild\mod
ule\source\13
copying sipbuild\module\source\13\LICENSE-GPL2 -> build\lib.win32-3.10\sipbuil
d\module\source\13
copying sipbuild\module\source\13\LICENSE-GPL3 -> build\lib.win32-3.10\sipbuil
d\module\source\13
copying sipbuild\module\source\13\MANIFEST.in -> build\lib.win32-3.10\sipbuild
\module\source\13
copying sipbuild\module\source\13\objmap.c -> build\lib.win32-3.10\sipbuild\mo
dule\source\13
copying sipbuild\module\source\13\pyproject.toml -> build\lib.win32-3.10\sipbu
ild\module\source\13
copying sipbuild\module\source\13\README.in -> build\lib.win32-3.10\sipbuild\m
odule\source\13
copying sipbuild\module\source\13\setup.cfg.in -> build\lib.win32-3.10\sipbuil
d\module\source\13
copying sipbuild\module\source\13\setup.py.in -> build\lib.win32-3.10\sipbuild
\module\source\13
copying sipbuild\module\source\13\sip.h.in -> build\lib.win32-3.10\sipbuild\mo
dule\source\13
copying sipbuild\module\source\13\sip.pyi -> build\lib.win32-3.10\sipbuild\mod
ule\source\13
copying sipbuild\module\source\13\sip.rst.in -> build\lib.win32-3.10\sipbuild\
module\source\13
copying sipbuild\module\source\13\sipint.h -> build\lib.win32-3.10\sipbuild\mo
dule\source\13
copying sipbuild\module\source\13\siplib.c -> build\lib.win32-3.10\sipbuild\mo
dule\source\13
copying sipbuild\module\source\13\threads.c -> build\lib.win32-3.10\sipbuild\m
odule\source\13
copying sipbuild\module\source\13\voidptr.c -> build\lib.win32-3.10\sipbuild\m
odule\source\13
running build_ext
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Roaming\Python\Python310-32\site-packages\pip\_
vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\Admin\AppData\Roaming\Python\Python310-32\site-packages\pip\_
vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\Admin\AppData\Roaming\Python\Python310-32\site-packages\pip\_
vendor\pep517\in_process\_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\build_meta.py", line 230, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 49, in <module>
setup(
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\__init__.py", line 155, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\wheel\bdist_wheel.py", line 299, in run
self.run_command('build')
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\command\build_ext.py", line 79, in run
_build_ext.run(self)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\command\build_ext.py", line 448, in build_ext
ensions
self._build_extensions_serial()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\command\build_ext.py", line 473, in _build_ex
tensions_serial
self.build_extension(ext)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\command\build_ext.py", line 202, in build_extension
_build_ext.build_extension(self, ext)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\command\build_ext.py", line 528, in build_ext
ension
objects = self.compiler.compile(sources,
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\_msvccompiler.py", line 327, in compile
self.initialize()
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\_distutils\_msvccompiler.py", line 224, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\msvc.py", line 316, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-py_mvk7m\overlay\Lib\s
ite-packages\setuptools\msvc.py", line 270, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
setuptools._distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0
or greater is required. Get it with "Microsoft C++ Build Tools": https://visual
studio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for sip
Failed to build sip
ERROR: Could not build wheels for sip, which is required to install pyproject.toml-based projects
Can you please help me find the problem.
I wrote this ( line copied from https://pypi.org/project/sip/ ) :
pip install sip
OS : Microsoft Windows 8.1 Pro [Version 6.3.9600]
Python Version: 3.10.0
PIP Version: 21.3.1
I just tried installing sip in a venv, and it went smoothly. I guess you need to upgrade pip:
pip install --upgrade pip
and then run again the installation script:
pip install sip
Run the command in the script directory on this path C:\Users\XXXXX\AppData\Local\Programs\Python\Python310\Scripts
I founded that method on this video:
https://www.youtube.com/watch?v=YVfvLYM2Yes&ab_channel=MustufaBaig
This method worked for me.

python can't install, build pycrypto

When installing "pip3 install pycrypto" I have this error:
creating build/lib.linux-armv7l-3.6/Crypto/Protocol
copying lib/Crypto/Protocol/AllOrNothing.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
copying lib/Crypto/Protocol/Chaffing.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
copying lib/Crypto/Protocol/KDF.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
copying lib/Crypto/Protocol/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
creating build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_slowmath.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/pubkey.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
creating build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/PKCS1_v1_5.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
warning: PCTBuildPy: byte-compiling is disabled, skipping.
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/tmp/pip-build-71pdfh2i/pycrypto':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 456, in <module>
core.setup(**kw)
File "/core.py", line 148, in setup
File "/dist.py", line 955, in run_commands
File "/dist.py", line 974, in run_command
File "/opt/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/install.py", line 545, in run
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/build.py", line 135, in run
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 251, in run
self.run_command(cmd_name)
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error
----------------------------------------
Command "/opt/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-71pdfh2i/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-cbi74gir-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-71pdfh2i/pycrypto/
My mount:
root#router2:~# mount
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /tmp type ramfs (rw,relatime)
none on /dev type tmpfs (rw,relatime,size=512K)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
devpts on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /opt type ext4 (rw,relatime,data=ordered)
/dev/sda1 on /tmp/mnt/sda1 type ext4 (rw,relatime,data=ordered)
When using TMPDIR=/opt/tmp pip3 install pycrypto I also have problem (google showed that TMPDIR must be mounted without "noexec"):
creating build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/pubkey.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_slowmath.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
creating build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/PKCS1_v1_5.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
warning: PCTBuildPy: byte-compiling is disabled, skipping.
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/opt/tmp/pip-build-ve5o0p9a/pycrypto':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 456, in <module>
core.setup(**kw)
File "/core.py", line 148, in setup
File "/dist.py", line 955, in run_commands
File "/dist.py", line 974, in run_command
File "/opt/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/install.py", line 545, in run
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/build.py", line 135, in run
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 251, in run
self.run_command(cmd_name)
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error
----------------------------------------
Command "/opt/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /opt/tmp/pip-xa11ohvn-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /opt/tmp/pip-build-ve5o0p9a/pycrypto/
gcc, autoconf, automake, python3-dev, python3-pip, python-crypto, python-cryptography were installed.
opkg install gcc, autoconf automake python3-dev, python3-pip, python-crypto, python-cryptography
I tried set HOME=/opt/tmp and TMPDIR=/opt/tmp
or HOME=/opt/tmp TMPDIR=/opt/tmp pip3 install pycrypto
but the problem is the same as above.
I read https://github.com/Entware-ng/Entware-ng/wiki/Self-installation-of-python-modules and follow it but wasn't successful.
pycrypto is requirement xiaomi component of hass
Please note that this is for python 3 not python 2.
Platform:
Buffalo WZR-1750DHP
Firmware: DD-WRT v3.0-r33006 std (08/03/17)
Please advise how to fix this issue.
Thank you!

ImportError: No module named numpy.distutils.core while installing XGBoost in Windows/Python

I am planning to install the XGBoost package in Python for Windows. After following the instructions mentioned here (How to install xgboost package in python (windows platform)?), I am facing issues during the last step (python setup.py install).
$ python setup.py install --user
Install libxgboost from: ['..\\lib\\xgboost.dll']
running install
running bdist_egg
running egg_info
writing requirements to xgboost.egg-info\requires.txt
writing xgboost.egg-info\PKG-INFO
writing top-level names to xgboost.egg-info\top_level.txt
writing dependency_links to xgboost.egg-info\dependency_links.txt
reading manifest file 'xgboost.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'xgboost\include'
warning: no files found matching '*' under directory 'xgboost\src'
warning: no files found matching '*' under directory 'xgboost\make'
warning: no files found matching '*' under directory 'xgboost\rabit'
warning: no files found matching '*' under directory 'xgboost\lib'
warning: no files found matching '*' under directory 'xgboost\dmlc-core'
warning: no previously-included files matching '*.o' found anywhere in distribut ion
warning: no previously-included files matching '*.a' found anywhere in distribut ion
warning: no previously-included files matching '*.pyo' found anywhere in distrib ution
warning: no previously-included files matching '*.pyc' found anywhere in distrib ution
writing manifest file 'xgboost.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
creating build\bdist.win32\egg
creating build\bdist.win32\egg\xgboost
copying build\lib\xgboost\build-python.sh -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\callback.py -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\compat.py -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\core.py -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\libpath.py -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\plotting.py -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\rabit.py -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\sklearn.py -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\training.py -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\VERSION -> build\bdist.win32\egg\xgboost
copying build\lib\xgboost\__init__.py -> build\bdist.win32\egg\xgboost
byte-compiling build\bdist.win32\egg\xgboost\callback.py to callback.pyc
byte-compiling build\bdist.win32\egg\xgboost\compat.py to compat.pyc
byte-compiling build\bdist.win32\egg\xgboost\core.py to core.pyc
byte-compiling build\bdist.win32\egg\xgboost\libpath.py to libpath.pyc
byte-compiling build\bdist.win32\egg\xgboost\plotting.py to plotting.pyc
byte-compiling build\bdist.win32\egg\xgboost\rabit.py to rabit.pyc
byte-compiling build\bdist.win32\egg\xgboost\sklearn.py to sklearn.pyc
byte-compiling build\bdist.win32\egg\xgboost\training.py to training.pyc
byte-compiling build\bdist.win32\egg\xgboost\__init__.py to __init__.pyc
installing package data to build\bdist.win32\egg
running install_data
copying ..\lib\xgboost.dll -> build\bdist.win32\egg\xgboost
creating build\bdist.win32\egg\EGG-INFO
copying xgboost.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
copying xgboost.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
copying xgboost.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
copying xgboost.egg-info\not-zip-safe -> build\bdist.win32\egg\EGG-INFO
copying xgboost.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO
copying xgboost.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
creating 'dist\xgboost-0.6-py2.7.egg' and adding 'build\bdist.win32\egg' to it
removing 'build\bdist.win32\egg' (and everything under it)
Processing xgboost-0.6-py2.7.egg
creating c:\users\mishraji\appdata\roaming\python\python27\site-packages\xgboost -0.6-py2.7.egg
Extracting xgboost-0.6-py2.7.egg to c:\users\mishraji\appdata\roaming\python\pyt hon27\site-packages
Adding xgboost 0.6 to easy-install.pth file
Installed c:\users\mishraji\appdata\roaming\python\python27\site-packages\xgboos t-0.6-py2.7.egg
Processing dependencies for xgboost==0.6
Searching for scipy
Reading https://pypi.python.org/simple/scipy/
Downloading https://pypi.python.org/packages/52/67/d9ef9b5058d4a9e3f0ae641ec1517 90622cbeb37f157de5773358e2bf3da/scipy-0.19.1.tar.gz#md5=6b4d91b62f1926282b127194 a06b72b3
Best match: scipy 0.19.1
Processing scipy-0.19.1.tar.gz
Writing c:\users\mishraji\appdata\local\temp\easy_install-cxrtxb\scipy-0.19.1\se tup.cfg
Running scipy-0.19.1\setup.py -q bdist_egg --dist-dir c:\users\mishraji\appdata\ local\temp\easy_install-cxrtxb\scipy-0.19.1\egg-dist-tmp-hya72r
c:\users\mishraji\appdata\local\temp\easy_install-cxrtxb\scipy-0.19.1\setup.py:3 23: UserWarning: Unrecognized setuptools command, proceeding with generating Cyt hon sources and expanding templates
warnings.warn("Unrecognized setuptools command, proceeding with "
Traceback (most recent call last):
File "setup.py", line 42, in <module>
url='https://github.com/dmlc/xgboost')
File "C:\Python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 67, i n run
self.do_egg_install()
File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 117, in do_egg_install
cmd.run()
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 410, in run
self.easy_install(spec, not self.no_deps)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 646, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 697, in install_item
self.process_distribution(spec, dist, deps)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 742, in process_distribution
[requirement], self.local_index, self.easy_install
File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 850, in r esolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1122, in best_match
return self.obtain(req, installer)
File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1134, in obtain
return installer(requirement)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 665, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 695, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 876, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1115, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1101, in run_setup
run_setup(setup_script, args)
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 251, in run_s etup
raise
File "C:\Python27\lib\contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 198, in setup _context
yield
File "C:\Python27\lib\contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 169, in save_ modules
saved_exc.resume()
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 144, in resum e
six.reraise(type, exc, self._tb)
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 157, in save_ modules
yield saved
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 198, in setup _context
yield
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 248, in run_s etup
DirectorySandbox(setup_dir).run(runner)
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 278, in run
return func()
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 246, in runne r
_execfile(setup_script, ns)
File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 47, in _execf ile
exec(code, globals, locals)
File "c:\users\mishraji\appdata\local\temp\easy_install-cxrtxb\scipy-0.19.1\se tup.py", line 416, in <module>
File "c:\users\mishraji\appdata\local\temp\easy_install-cxrtxb\scipy-0.19.1\se tup.py", line 396, in setup_package
ImportError: No module named numpy.distutils.core
However, when I import the package in python, it works without any issue.
import numpy.distutils.core as np
The issue occured because I had two python versions (v 2.7.13) and Enthought Canopy (Python 2.7.11). As Python 2.7.11 already had Numpy package, xgboost got installed successfully.
python setup.py install
For me in a Docker, installing numpy first worked:
RUN pip install numpy==1.8.1
RUN pip install scikit-fmm==0.0.9

error: Unable to find vcvarsall.bat in installing psycopg2 in windows7

Im using Windows 7 for developing Django 1.3.7 using PostgreSQL 9.3 as database. on my settings.py I set DATABASE_ENGINE = 'django.db.backends.postgresql_psycopg2' but when I try to execute python manage.py syncdb I got this error:
C:\Django-Proj\myproj\myproj>python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 61, in <module>
execute_manager(settings)
File "c:\Python27\lib\site-packages\django\core\management\__init__.py", line
438, in execute_manager
utility.execute()
File "c:\Python27\lib\site-packages\django\core\management\__init__.py", line
379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "c:\Python27\lib\site-packages\django\core\management\__init__.py", line
261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "c:\Python27\lib\site-packages\django\core\management\__init__.py", line
67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "c:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "c:\Python27\lib\site-packages\django\core\management\commands\syncdb.py"
, line 7, in <module>
from django.core.management.sql import custom_sql_for_model, emit_post_sync_
signal
File "c:\Python27\lib\site-packages\django\core\management\sql.py", line 6, in
<module>
from django.db import models
File "c:\Python27\lib\site-packages\django\db\__init__.py", line 78, in <modul
e>
connection = connections[DEFAULT_DB_ALIAS]
File "c:\Python27\lib\site-packages\django\db\utils.py", line 93, in __getitem
__
backend = load_backend(db['ENGINE'])
File "c:\Python27\lib\site-packages\django\db\utils.py", line 33, in load_back
end
return import_module('.base', backend_name)
File "c:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "c:\Python27\lib\site-packages\django\db\backends\postgresql_psycopg2\bas
e.py", line 24, in <module>
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No m
odule named psycopg2
Then I try to install psycopg2 but it got an error:
C:\>pip install psycopg2
Downloading/unpacking psycopg2
Running setup.py (path:c:\users\samuel\appdata\local\temp\pip_build_Samuel\psy
copg2\setup.py) egg_info for package psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
error: Unable to find vcvarsall.bat
Complete output from command C:\Python27\python.exe -c "import setuptools, t
okenize;__file__='c:\\users\\samuel\\appdata\\local\\temp\\pip_build_Samuel\\psy
copg2\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().r
eplace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\samuel\appda
ta\local\temp\pip-dsnjrg-record\install-record.txt --single-version-externally-m
anaged --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\psycopg2
copying lib\errorcodes.py -> build\lib.win-amd64-2.7\psycopg2
copying lib\extensions.py -> build\lib.win-amd64-2.7\psycopg2
copying lib\extras.py -> build\lib.win-amd64-2.7\psycopg2
copying lib\pool.py -> build\lib.win-amd64-2.7\psycopg2
copying lib\psycopg1.py -> build\lib.win-amd64-2.7\psycopg2
copying lib\tz.py -> build\lib.win-amd64-2.7\psycopg2
copying lib\_json.py -> build\lib.win-amd64-2.7\psycopg2
copying lib\_range.py -> build\lib.win-amd64-2.7\psycopg2
copying lib\__init__.py -> build\lib.win-amd64-2.7\psycopg2
creating build\lib.win-amd64-2.7\psycopg2\tests
copying tests\dbapi20.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\dbapi20_tpc.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\testconfig.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\testutils.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_async.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_bugX000.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_bug_gc.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_cancel.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_connection.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_copy.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_cursor.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_dates.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_extras_dictcursor.py -> build\lib.win-amd64-2.7\psycopg2\test
s
copying tests\test_green.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_lobject.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_module.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_notify.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_psycopg2_dbapi20.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_quote.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_transaction.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_types_basic.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_types_extras.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\test_with.py -> build\lib.win-amd64-2.7\psycopg2\tests
copying tests\__init__.py -> build\lib.win-amd64-2.7\psycopg2\tests
running build_ext
building 'psycopg2._psycopg' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Cleaning up...
Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\use
rs\\samuel\\appdata\\local\\temp\\pip_build_Samuel\\psycopg2\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\samuel\appdata\local\temp\pip-dsnjrg-
record\install-record.txt --single-version-externally-managed --compile failed w
ith error code 1 in c:\users\samuel\appdata\local\temp\pip_build_Samuel\psycopg2
Storing debug log for failure in C:\Users\Samuel\pip\pip.log
Does anyone have an idea about my case? thanks in advance
There is the huge list of Unofficial Windows Binaries for Python Extension Packages which are extremely useful for Windows users.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg
Go to the link, download and install it and you are good to go.
Cheers !
Don't try to compile psycopg2 for Windows. You'll need a Visual Studio install or Windows SDK and all sorts of other mess.
Just grab a binary build: http://initd.org/psycopg/download/

Categories

Resources