Plone-5.0.7-UnifiedInstaller ImportError issue

plone newbie here, trying to install plone from scratch.
the installation went without errors: https://pastebin.com/ficHz0i7

however when i try to start up the instance, i get:

    (zinstance) [vagrant@dev Plone-5.0.7]$ ./zinstance/bin/plonectl start
instance: Traceback (most recent call last):
  File "/home/vagrant/src/Plone-5.0.7/zinstance/bin/instance", line 259, in <module>
    import plone.recipe.zope2instance.ctl
  File "/home/vagrant/src/Plone-5.0.7/buildout-cache/eggs/plone.recipe.zope2instance-4.2.22-py2.7.egg/plone/__init__.py", line 2, in <module>
    __import__('pkg_resources').declare_namespace(__name__)
  File "/home/vagrant/src/Plone-5.0.7/zinstance/lib/python2.7/site-packages/pkg_resources/__init__.py", line 35, in <module>
    import plistlib
  File "/usr/lib64/python2.7/plistlib.py", line 62, in <module>
    import datetime
  File "/home/vagrant/src/Plone-5.0.7/buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/datetime/__init__.py", line 14, in <module>
    from .DateTime import DateTime
  File "/home/vagrant/src/Plone-5.0.7/buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/datetime/DateTime.py", line 24, in <module>
    from datetime import datetime
  File "/home/vagrant/src/Plone-5.0.7/buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/datetime/datetime.py", line 24, in <module>
    from datetime import datetime
ImportError: cannot import name datetime

is some other package called datetime shadowing the built-in python one?

some further information i omitted: the environment is vagrant box with centos 7

i think i have narrowed down the problem to the --target parameter:

no ImportError (installed into default /home/vagrant/Plone):

./install.sh standalone --password=admin

ImportError:

./install.sh standalone --password=admin --target=/home/vagrant/src/p

This looks really weird. Locally on my Mac, the DateTime egg has a DateTime folder and a DateTime.py file. It certainly has no lowercase datetime or datetime.py.
I don't know if this is some weird CentOS specific problem.
You could remove the egg, rerun buildout, and see if that helps.

sorry for the late answer. those files are not present:

~/Plone/buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/DateTime $ ls -1
DateTime.py
DateTime.pyc
DateTime.txt
__init__.py
__init__.pyc
interfaces.py
interfaces.pyc
pytz_support.py
pytz_support.pyc
pytz.txt
tests

i did some more experiments. 3 more installations using command line:

./install.sh standalone --password=admin
./install.sh standalone --password=admin --target=/home/vagrant/Plone
./install.sh standalone --password=admin --target=/home/vagrant/src/tmp/plone

(the first 2 are basically identical)
as before, the first 2 can start an instance, the custom target path fails with the same import error.

i changed DateTime.py:

24 import pprint; pprint.pprint(sys.path)
25 from datetime import datetime

after stripping away the install path, this is the only difference between the 2 instances:

--- ~/Plone/log  2017-05-02 11:33:12.283051758 +0200
+++ ~/src/tmp/plone/log    2017-05-02 11:39:25.000000000 +0200
@@ -512,7 +512,7 @@
  'buildout-cache/eggs/collective.elephantvocabulary-0.2.5-py2.7.egg',
  'buildout-cache/eggs/Products.DateRecurringIndex-2.1-py2.7.egg',
  'buildout-cache/eggs/zope.keyreference-3.6.4-py2.7.egg',
- 'zinstance/parts/instance/bin',
+ 'zinstance/bin',
  'zinstance/lib64/python27.zip',
  'zinstance/lib64/python2.7',
  'zinstance/lib64/python2.7/plat-linux2',

i am not sure where to go from here... any ideas?

i am sorry, it's definitely an issue on my side :frowning:

~/Plone: linux case sensitive FS inside VM
~/src/tmp/plone: vagrant shared folder from host (OSX case insensitive)

any --target i specifed inside the VM FS works. sorry for the noise.

$ cd ~/src/tmp/plone
$ ls -la buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/
total 0
drwxr-xr-x. 1 vagrant vagrant   136 Mar  4  2016 .
drwxr-xr-x. 1 vagrant vagrant 10030 May  2 09:21 ..
drwxr-xr-x. 1 vagrant vagrant   408 May  2 11:55 DateTime
drwxr-xr-x. 1 vagrant vagrant   272 Mar  4  2016 EGG-INFO 

$ ls -id buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/DateTime
88771 buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/DateTime

$ ls -id buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/datetime
114063 buildout-cache/eggs/DateTime-4.0.1-py2.7.egg/datetime

it's a different inode (maybe because of vagrant?), but for the underlying file system (OSX case insensitive) they are the same folder. on the host:

$ uname -a
Darwin macbook 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
$ touch X
$ ls -lai X x
4663016 -rw-r--r--  1 user  user  0 May  2 12:08 X
4663016 -rw-r--r--  1 user  user  0 May  2 12:08 x

again, sorry for the noise. maybe a candidate for FAQ :smiley:

Ah, now you mention it, I have seen similar problems with case insensitive Mac and case sensitive Docker.

Do you have a suggestion on where to add such information? Maybe you can create an issue for this. The best place for an issue is probably here: https://github.com/plone/Installers-UnifiedInstaller/issues

BTW, both DateTime and datetime modules exist. datetime is a core Python module. DateTime is a Zope module used by Plone. DateTime was created before datetime existed.

this is not a UnifiedInstaller issue per se (although it would be trivial to add a "case sensitivity check" to the installer script), but a python one.

still, perhaps it could be added to https://docs.plone.org/manage/troubleshooting/exceptions.html

I have created a pull request for updated documentation: