Psychopy: Cannot install with py3K: invalid syntax

Created on 17 Oct 2017  Â·  4Comments  Â·  Source: psychopy/psychopy

To install psychopy with py3k, I tried first to

pip3 install  --user git+https://github.com/psychopy/psychopy@python3

This installed all dependencies etc but failed with:

Collecting git+https://github.com/psychopy/psychopy@python3
  Cloning https://github.com/psychopy/psychopy (to python3) to /private/var/folders/0t/crx5yf1x3rd8378nbqbv00vc0000gn/T/pip-f80gciyc-build
    Complete output from command python setup.py egg_info:
    wrote init for 1.85.1 b'bddae683'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/0t/crx5yf1x3rd8378nbqbv00vc0000gn/T/pip-f80gciyc-build/setup.py", line 35, in <module>
        exec(vStr)
      File "<string>", line 21
        __git_sha__ = 'b'bddae683''
                                ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0t/crx5yf1x3rd8378nbqbv00vc0000gn/T/pip-f80gciyc-build/

to check what was wrong, I tried this:

git clone https://github.com/psychopy/psychopy

cd psychopy
git checkout python3
pip3 install --user .

which reproduces the error. This is due to the fact that the extracted git_sha is byte-encoded (one of the novelties from python 3) and that doing this simple trick allowed to complete the installation. I can run my experiments from the command line using python 3, thanks!

diff --git a/createInitFile.py b/createInitFile.py
index 841939de..082415ce 100644
--- a/createInitFile.py
+++ b/createInitFile.py
@@ -56,7 +56,7 @@ __maintainer_email__ = '[email protected]'
 __users_email__ = '[email protected]'
 __url__ = 'http://www.psychopy.org'
 __downloadUrl__ = 'https://github.com/psychopy/psychopy/releases/'
-__git_sha__ = '{shaStr}'
+__git_sha__ = {shaStr}
 __build_platform__ = '{platform}'

 __all__ = ["gui", "misc", "visual", "core",

As it involved only 2 chars, I have not created a PR :-)

Most helpful comment

this branch could be renamed to something more explicit like olddev_python3 ?

I believe it should simply be deleted… :)

All 4 comments

The python3 branch is massively outdated. We are working on Py3 support in master now. I strongly discourage using PsychoPy on Python 3 for anything more than just playing around a bit, though. We haven’t even set up proper tests yet. Expect dozens of smaller and sometimes larger things to be broken.

Thanks for the note - this branch could be renamed to something more explicit like olddev_python3 ?

and indeed, the install works smoothly with:

pip3 install  --user git+https://github.com/psychopy/psychopy

I stay with that version and will report any problem I would have, but so far all runs fine.

this branch could be renamed to something more explicit like olddev_python3 ?

I believe it should simply be deleted… :)

FYI this branch was something that @cbrnr had worked on and I kept it around so I could see the steps and fixes he had gone through. I think the master branch has got as far as his branch had done (but with dual support) so yes, I'll delete it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

janfreyberg picture janfreyberg  Â·  12Comments

mmagnuski picture mmagnuski  Â·  9Comments

hoechenberger picture hoechenberger  Â·  10Comments

tiborauer picture tiborauer  Â·  7Comments

luketudge picture luketudge  Â·  14Comments