2

I'm trying to import PyGreSQL in Python. I've successfully installed it with pip, and also have GLFW3 installed, but I run into the following error when I import

>>> import pg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//anaconda/lib/py
thon3.5/site-packages/pg/__init__.py", line 1, in <module>
    from .core import (
  File "//anaconda/lib/python3.5/site-packages/pg/core.py", line 6, in <module>
    from . import glfw
  File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 138, in <module>
    ['', '/usr/lib', '/usr/local/lib'], _glfw_get_version)
  File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 74, in _load_library
    version = version_check_callback(filename)
  File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 130, in _glfw_get_version
    out = process.communicate(_to_char_p(filename))[0]
  File "//anaconda/lib/python3.5/subprocess.py", line 801, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "//anaconda/lib/python3.5/subprocess.py", line 1428, in _communicate
    self._save_input(input)
  File "//anaconda/lib/python3.5/subprocess.py", line 1501, in _save_input
    self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'>>> import pg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//anaconda/lib/python3.5/site-packages/pg/__init__.py", line 1, in <module>
    from .core import (
  File "//anaconda/lib/python3.5/site-packages/pg/core.py", line 6, in <module>
    from . import glfw
  File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 138, in <module>
    ['', '/usr/lib', '/usr/local/lib'], _glfw_get_version)
  File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 74, in _load_library
    version = version_check_callback(filename)
  File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 130, in _glfw_get_version
    out = process.communicate(_to_char_p(filename))[0]
  File "//anaconda/lib/python3.5/subprocess.py", line 801, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "//anaconda/lib/python3.5/subprocess.py", line 1428, in _communicate
    self._save_input(input)
  File "//anaconda/lib/python3.5/subprocess.py", line 1501, in _save_input
    self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'

What can I do to fix this and get PyGreSQL working?

Noah Walton
  • 123
  • 2
  • 8

0 Answers0