0

I am very new to python and plan to use psychopy quite a lot. I am on a work computer but have full admin rights.
Psychopy came with python version 2.7.11 and includes setuptools already. I am trying to install the selenium module, but having trouble getting pip to work at all.

In cmd, it is recognising the 'python' command, so I know python is in my path.

I get the message "can't open file 'pip': [Errno2] No such file or directory" from:

python pip install selenium

I get " 'pip' is not recognised as an internal or external command" from:

pip install selenium

When I change directory to where pip is located, I get: Fatal error in launcher: Unable to create process using '"'

Using pip2 makes no difference.

It seems a simple thing but where am I going wrong with this?!

Phil
  • 51
  • 6
  • Maybe pip is not installed? What operating system are you using? If ubuntu you might need to do something like `sudo apt-get install pip` or pip2? You can also try `which pip2` at command line and it should show you where it is if it is installed and on your path. – brittAnderson May 04 '17 at 16:02
  • Also, a lot more help goes on now at the discourse site: https://discourse.psychopy.org/ – brittAnderson May 04 '17 at 16:04
  • Thanks brittUWaterloo. pip is definitely installed and in the scripts folder. It's not in path but still doesn't work when cmd is run from the scripts folder. I'll try asking at discourse, I just thought maybe I was missing something obvious with the basic Python command. – Phil May 04 '17 at 19:49
  • Forgot to say, I'm using Windows 7 and I'll check out the which pip command when I get back. Thanks @brittUWaterloo – Phil May 04 '17 at 20:01
  • In the first example, pip isn't something that gets run by Python. In the second example, check this answer: http://stackoverflow.com/questions/23708898/pip-is-not-recognized-as-an-internal-or-external-command – Michael MacAskill May 04 '17 at 21:25

2 Answers2

0

I never really got to the bottom of this, but this is what I found out and here are the commands that worked for me in Windows. Be aware that I am far from expert!

To run python scripts (*.py) from command line (cmd) then C:\PsychoPy2 and C:\PsychoPy2\DLLs need to be in path. ('Path' contains directories or file extensions that can be more globally accessed, i.e. do not require you to change the prompt to the relevant directories first). To check, open cmd and either type echo %PATH% or just type python. (If python starts, the line will say >>>. You can exit by typing quit()) To add to path, get properties of computer, then advanced system settings, then environment variables. To check pip.exe (a sort of installation wizard) is installed, either search for the file, or check C:\PsychoPy2\Scripts for it. This may also need to be in path.

To reinstall the latest versions of pip and setup tools, I went to cmd and typed:

python -m pip install -U pip setuptools

If the same code did not work for other modules (which in my case was due to network access), then I downloaded the wheel file (*.whl) for that module (from their website) and ran the following code:

python -m pip install c:/modulename.whl

These may not be the correct ways of doing things, but they worked for me when I couldn't get other ways to work!

Phil
  • 51
  • 6
0

I've just had the exact same issue with the pip install, and a conflict with PsychoPy installations. I think it's because python automatically wants to call on the path that's been set by Psychopy, so it can't get to the 'pip' folders that for me, remain in a temporary/hidden file. This wasn't intuitive for me - on any machine without psychopy python just 'works' when you download it.

JEaves
  • 1