Skip to content

Commit

Permalink
Merge pull request psychopy#1445 from kaczmarj/fix-setup-py3
Browse files Browse the repository at this point in the history
FIX: pip install on python3
  • Loading branch information
peircej committed Jun 23, 2017
2 parents 648d4d8 + b403008 commit 8d4d08f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
17 changes: 11 additions & 6 deletions createInitFile.py
Expand Up @@ -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):
Expand Down
17 changes: 11 additions & 6 deletions psychopy/__init__.py
Expand Up @@ -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
6 changes: 3 additions & 3 deletions setup.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python
"""Install PsychoPy to your current Python dist, including requirements
usage::
Expand All @@ -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')

Expand Down

0 comments on commit 8d4d08f

Please sign in to comment.