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): 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 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')