How to install PsychoPy from GitHub?

Assuming that I have already installed its dependencies (with pip), then how do I install a forked&cloned copy of psychopy from GitHub into my Python interpreter? Will it work to drag the psychopy/psychopy folder out of the git clone to /python2.7/site-packages/psychopy? Or is there some other/better way I am supposed to do that?

Also, if I pull out just the psychopy sub-folder from under the root psychopy folder to install that on my local Python interpreter, does splitting out that directory from pyschopy’s root directory confuse git? Because if I did anything worthwhile I would then want to push it back up to my fork and generate a pull request.

best,

Allen

This depends on what you want the installation for:

  • If you are wanting a development copy, then keep it in its own git cloned directory. You’re going to often be doing git pull upstream master to get the latest development version from psychopy/psychopy at GitHub, and then git push to shift changes back to your fork on GitHub, so you shouldn’t be moving files around to other directories. That would be fighting against the git workflow, especially of it automatically detecting all changes since the last commit.
    To launch the application from the command line, you just need to point Python to that folder.
  • If you want a version so that you can run experiments from the command line rather than via the standalone app, that’s a different situation.You would generally want to download a specific version so that it is stable over the course of the study, and not subject to the issues that are present in the unreleased development version. In that case, I guess it makes sense for that stable release to go in your site packages directory so you can just python your_experiment_script.py? I just run experiments from the standalone app, though, so I’m not the best to advise on this set-up.

Michael,

Thanks, but not quite what I am looking for. I am using Anaconda and PyCharm with PsychoPy and its dependencies installed with pip. I want to, flexibly, import PsychoPy modules from either the PsychoPy tree installed with pip or from the local file tree cloned from my fork on GitHub.

Maybe I could use Anaconda virtual environments and PYTHONPATH or sys.path.append() to add the PsychoPy path under the git tree?

-Allen

This recommends using PYTHONPATH to point into the dev. folder, so I’ll do that and also find a convenient way to change where it points depending on which version of PsychoPy I need to develop with.

- Allen

1 Like