0

I get an error when trying to install p4python on macOS 10.15 Catalina.
Command pip install p4python.

Cannot build P4Python without SSL support
Exception: Parameter –ssl is needed

When I try to install an older version, I also get an error.
Command pip install p4python==2018.2.1743033.

Cannot match OpenSSL Version string ‘LibreSSL 2.8.3’
Cannot build P4Python without SSL support

The second error seems to be caused by macOS using LibreSSL instead of OpenSSL.

Any ideas how to get it installed?

Craig
  • 9,335
  • 2
  • 34
  • 38
Synck
  • 2,727
  • 22
  • 20

3 Answers3

2

p4python can not be installed because it doesn't have a package for Python 3.8. Which is the Python 3 version installed by default. The latest release only has packages for Python up-to 3.7: p4python 2019.1.1858212 PyPI

I installed Python 3.7 with pyenv to get p4python installed/working.

// install pyenv and required python version
brew install pyenv
pyenv install 3.7.7

// add following to ~/.bash_profile
export PYENV_ROOT="$HOME/.pyenv/shims"
export PATH="$PYENV_ROOT:$PATH"
export PIPENV_PYTHON="$PYENV_ROOT/python"

// go to project directory and set python version
cd project
pyenv local 3.7.7
// check verion
python --version
// install p4python
pip install p4python

Old answer:

Answer from Perforce Technical Support

p4python is not supported on MacOS 10.15.2.

Synck
  • 2,727
  • 22
  • 20
1

I had the same issue on Windows and answered a similar question here: Cannot build P4Python without SSL support win 10

I suspect the same answer applies to macosx:

The issue is that p4python is released for specific versions of python on windows and macosx. Look in https://pypi.org/project/p4python/#files and search for the "macosx". You will see cpXY in the filename, ex. cp39 indicating that this package will work on python X.Y, ex. 3.9. Trying to install p4python on an unsupported version of python will result in this error.

GaspardP
  • 4,217
  • 2
  • 20
  • 33
0

Have you tried doing exactly what it's telling you to do?

pip install p4python -ssl

Alan Kavanagh
  • 9,425
  • 7
  • 41
  • 65
  • That seems to pass the option to pip and not to p4python. Output: `Usage: pip install [options] ... no such option: --ssl` – Synck Dec 20 '19 at 08:04
  • You might look at this answer then: https://stackoverflow.com/questions/677577/distutils-how-to-pass-a-user-defined-parameter-to-setup-py – Alan Kavanagh Dec 20 '19 at 10:14
  • Basically you're trying to run the setup.py and pass it the -ssl command: https://swarm.workshop.perforce.com/files/guest/perforce_software/p4python/setup.py?v=7 – Alan Kavanagh Dec 20 '19 at 10:14
  • You can either manually download the module and run the setup.py yourself or try to figure out how to pass an argument to setup.py via pip – Alan Kavanagh Dec 20 '19 at 10:15
  • I was able to pass the argument to setup.py via pip using following command: `pip install --install-option="--ssl" p4python`. But now I get the error `option --ssl not recognized` from setup.py. – Synck Jan 05 '20 at 13:25
  • According to the OP it only requires one dash before the `-ssl` : try `pip install --install-option="-ssl" p4python` – Alan Kavanagh Jan 05 '20 at 20:29
  • With `-ssl`as option the error `option -s not recognized` is returned. The script is checking for `if '--ssl' in sys.argv`. – Synck Jan 07 '20 at 08:45