From 9924f7bcf3bf077acbbdf082dcd4f0b192a95245 Mon Sep 17 00:00:00 2001 From: jakubk Date: Thu, 22 Jun 2017 16:21:47 -0400 Subject: [PATCH 1/3] FIX: suppress error if configobj not found (breaks pip install) --- psychopy/__init__.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/psychopy/__init__.py b/psychopy/__init__.py index a350712c7d..d2f73205d5 100644 --- a/psychopy/__init__.py +++ b/psychopy/__init__.py @@ -38,10 +38,15 @@ if output: __git_sha__ = output.strip() # remove final linefeed -# update preferences and the user paths -from psychopy.preferences import prefs -import sys -for pathName in prefs.general['paths']: - sys.path.append(pathName) +# This block of code breaks when attempting to pip install on python 3 because +# configobj is not found. Suppress the error if it involves configobj. +try: + # update preferences and the user paths + from psychopy.preferences import prefs + for pathName in prefs.general['paths']: + sys.path.append(pathName) -from psychopy.tools.versionchooser import useVersion, ensureMinimal + from psychopy.tools.versionchooser import useVersion, ensureMinimal +except ImportError as e: + if "configobj" not in e.msg: + raise From db6140718abbed2d480a2622100882bcfc1ea5e4 Mon Sep 17 00:00:00 2001 From: jakubk Date: Thu, 22 Jun 2017 16:34:44 -0400 Subject: [PATCH 2/3] FIX: suppress error if configobj not found (breaks pip install) --- createInitFile.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/createInitFile.py b/createInitFile.py index 27ebe85f0f..c13ff5c91c 100644 --- a/createInitFile.py +++ b/createInitFile.py @@ -79,13 +79,18 @@ def createInitFile(dist=None, version=None, sha=None): if output: __git_sha__ = output.strip() # remove final linefeed -# update preferences and the user paths -from psychopy.preferences import prefs -import sys -for pathName in prefs.general['paths']: - sys.path.append(pathName) +# This block of code breaks when attempting to pip install on python 3 because +# configobj is not found. Suppress the error if it involves configobj. +try: + # update preferences and the user paths + from psychopy.preferences import prefs + for pathName in prefs.general['paths']: + sys.path.append(pathName) -from psychopy.tools.versionchooser import useVersion, ensureMinimal + from psychopy.tools.versionchooser import useVersion, ensureMinimal +except ImportError as e: + if "configobj" not in e.msg: + raise """ def _getGitShaString(dist=None, sha=None): From b403008bacf6906e402d5605922f186c99344cda Mon Sep 17 00:00:00 2001 From: jakubk Date: Thu, 22 Jun 2017 16:35:36 -0400 Subject: [PATCH 3/3] FIX: use environment python instead of python2 + bugfixes --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 0e6b2fd572..d2973fc415 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python """Install PsychoPy to your current Python dist, including requirements usage:: @@ -23,12 +23,12 @@ 'python-bidi', 'cffi', 'future', 'json_tricks', 'pyosf', 'requests[security]', 'xlrd', 'openpyxl', - 'pyyaml', 'gevent', 'msgpack-python', 'psutil', 'tables' + 'pyyaml', 'gevent', 'msgpack-python', 'psutil', 'tables', 'opencv-python', ] # some optional dependencies if platform == 'darwin': - required.append('pyobjc-core', 'pyobjc-framework-Quartz') + required.extend(['pyobjc-core', 'pyobjc-framework-Quartz']) if PY3: # doesn't exist on py2 required.append('pyqt5')