plone / Installers-UnifiedInstaller

Linux/BSD/OSX Installer
28 stars 24 forks source link

Error on CentOS 7,.x for Plone 5.2 using Python 3.7 #89

Closed terapyon closed 5 years ago

terapyon commented 5 years ago

I tried to install Plone-5.2.0-UnifiedInstaller.tgz on CentOS 7.x. But I got an error message it was not able to find Python 3 runtime.

I installed Python by source compile version. Please any comment.

Or I want to build python in the install for Python 3. But I got Python 2.7 with --build-python option.

$ ./install.sh --with-python=/opt/python372/bin/python3 standalone

Testing /opt/python372/bin/python3 for Zope/Plone requirements....
Failed: We need to be able to use Python.h, which is missing.
You may be able to resolve this by installing the python-dev package.

/opt/python372/bin/python3 does not meet the requirements for Zope/Plone.

Please do one of the following:
1) Install python2.7 as a system dev package\;
2) Use --with-python=... option to point the installer to a useable python\; or
3) Use the --build-python option to tell the installer to build Python.
tkimnguyen commented 5 years ago

Hi Manabu! On Ubuntu I had to apt install python3-dev so the .h files could be found.

On Jul 22, 2019, at 00:30, Manabu TERADA notifications@github.com wrote:

I tried to install Plone-5.2.0-UnifiedInstaller.tgz on CentOS 7.x. But I got an error message it was not able to find Python 3 runtime.

I installed Python by source compile version. Please any comment.

Or I want to build python in the install for Python 3. But I got Python 2.7 with --build-python option.

$ ./install.sh --with-python=/opt/python372/bin/python3 standalone

Testing /opt/python372/bin/python3 for Zope/Plone requirements.... Failed: We need to be able to use Python.h, which is missing. You may be able to resolve this by installing the python-dev package.

/opt/python372/bin/python3 does not meet the requirements for Zope/Plone.

Please do one of the following: 1) Install python2.7 as a system dev package\; 2) Use --with-python=... option to point the installer to a useable python\; or 3) Use the --build-python option to tell the installer to build Python. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

terapyon commented 5 years ago

Hi Kim, I know Ubuntu is fine. But CentOS 7 does not have python3 package (I know we have only 3rd party package .) Because I want to use --build-python for Python 3.

svx commented 5 years ago

Hi, you may need third party repos: EPEL or IUS

Keep in mind that the name of the package may vary :)

yum search python3 | grep devel

After that depending which one you need or want to use for example:

yum install -y python3-devel.x86_64
svx commented 5 years ago

@smcmahon maybe we could add this to https://github.com/plone/Installers-UnifiedInstaller/blob/cbead67674d557c724be038f087523957b6c834c/preflight?

Like if you choose python3 the script will check for requirements

smcmahon commented 5 years ago

I'll see what I can figure out.

terapyon commented 5 years ago

@smcmahon Do you have a plan for the fix? or need a more time?

smcmahon commented 5 years ago

The tentative plan is to allow an argument to --build-python to specify the Python version. But I'm probably going to wait until the next + 0.0.1 release of Plone to implement.

terapyon commented 5 years ago

Thank you for your information.

terapyon commented 5 years ago

I installed IUS python-devel. but I got a same error. I tried to read the code. I think the below is the problem

https://github.com/plone/Installers-UnifiedInstaller/blob/e39575e219bdb3706cb21ebb6d677e51f2f95bfa/helper_scripts/checkPython.py#L21

if not os.path.isfile(os.path.join(sys.prefix, 'include', pythonv, 'Python.h')):

My env is the below.

>>> import sys
>>> sys.prefix
/usr

I checked my files. I found Python.h file.

/usr/include/python3.6m/Python.h

python3.6m is True?

doctbee commented 5 years ago

config (new VM with centos 7.6 Plone 5.2 Python3.6) checkPython is looking for /usr/include/python3.6/Python.h I symlink /usr/include/python3.6 to /usr/include/python3.6m and it works.

but i am unable to continue installation after that. too many errors with pip virtualenv wheel ....

Traceback (most recent call last): File "virtualenv.py", line 2580, in <module> main() File "virtualenv.py", line 831, in main symlink=options.symlink, File "virtualenv.py", line 1123, in create_environment install_wheel(to_install, py_executable, search_dirs, download=download) File "virtualenv.py", line 973, in install_wheel _install_wheel_with_search_dir(download, project_names, py_executable, search_dirs) File "virtualenv.py", line 1060, in _install_wheel_with_search_dir call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script) File "virtualenv.py", line 924, in call_subprocess raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode)) OSError: Command /applis/cyyp/portfol...luster/bin/python3.6 - setuptools pip wheel failed with error code 1 sudo: /applis/cyyp/portfolio/zeocluster/bin/pip : commande introuvable

I will continue to dig later. Has anyone ever succeeded with this configuration ?

smcmahon commented 5 years ago

terapyon: would you check to see if:

import distutils.sysconfig
distutils.sysconfig.get_python_inc(True)

returns the directory for your python.h?

Thanks!

terapyon commented 5 years ago

I just checked it. Looks good.

>>> import distutils.sysconfig
>>> distutils.sysconfig.get_python_inc(True) 
'/usr/include/python3.6m'
smcmahon commented 5 years ago

We have a new revision of the installer at https://launchpad.net/plone/5.2/5.2/+download/Plone-5.2.0-UnifiedInstaller-r1.tgz that allows "--build-python=3" and is tested and working for centos/7. It should also correctly detect the path for the python3 include files if the Python was installed by package.