google-code-export / django-hotclub

Automatically exported from code.google.com/p/django-hotclub
MIT License
0 stars 0 forks source link

pinax-boot.py from TRUNK fails under Ubuntu9 (development) #211

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce the problem:

1. according to http://pinaxproject.com/docs/trunk/install.html one should 
issue:

python pinax-boot.py pinax-env

2. it fails reporting this:

  Downloading http://pypi.python.org/packages/2.6/s/setuptools/setuptools-
0.6c9-py2.6.egg
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 2] No such file or directory: '/mnt/hdd2/pinooblet/pinax-
env/local/lib/python2.6/dist-packages/test-easy-install-11706.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /mnt/hdd2/pinooblet/pinax-env/local/lib/python2.6/dist-packages/

3. OK, I create this dir manually:

mkdir -p /mnt/hdd2/pinooblet/pinax-env/local/lib/python2.6/dist-packages/

and re-run script. 

4. Now it fails like that:

  Downloading http://pypi.python.org/packages/2.6/s/setuptools/setuptools-
0.6c9-py2.6.egg
TEST FAILED: /mnt/hdd2/pinooblet/pinax-env/local/lib/python2.6/dist-
packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /mnt/hdd2/pinooblet/pinax-env/local/lib/python2.6/dist-packages/

and your PYTHONPATH environment variable currently contains:

    ''

5. OK, I re-run script like this:

PYTHONPATH=/mnt/hdd2/pinooblet/pinax-env/local/lib/python2.6/dist-packages/ 
python pinax-boot.py pinax-env

6. Now it fails like that:

Installing setuptools............................done.
Fetching Pinax from http://svn.pinaxproject.com/pinax/trunk to pinax-
env/src/pinax
  Installing pip
  Error [Errno 2] No such file or directory while executing command pinax-
env/bin/easy_install --quiet pip

7. Please let me know if you need some additional info.

Original issue reported on code.google.com by khame...@gmail.com on 28 Mar 2009 at 10:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
$ ln -s ../local/bin/easy_install pinax-env/bin/easy_install

helps to fix item 6 above.

8. Now whilst re-running script as 

PYTHONPATH=/mnt/hdd2/pinooblet/pinax-env/local/lib/python2.6/dist-packages/ 
python 
pinax-boot.py pinax-env

we get:

Installing setuptools..............done.
Fetching Pinax from http://svn.pinaxproject.com/pinax/trunk to 
pinax-env/src/pinax
  Installing pip
  zip_safe flag not set; analyzing archive contents...
  pip: module references __file__
  Installing Django 1.0.2
  Error [Errno 2] No such file or directory while executing command pinax-env/bin/pip 
install Django --quiet

9. the above can be similarly fixed like this:
$ ln -s ../local/bin/pip pinax-env/bin/pip

10. re-run OK now

11. and now:

$ pip install --requirement src/pinax/requirements/external_apps.txt
Traceback (most recent call last):
  File "/mnt/hdd2/pinooblet/pinax-env/bin/pip", line 4, in <module>
    import pkg_resources
ImportError: No module named pkg_resource

12. the following doesn't seem to help:

sudo apt-get install python-pkg-resources

Original comment by khame...@gmail.com on 28 Mar 2009 at 10:50

GoogleCodeExporter commented 9 years ago
I'm not sure why but most of the errors described here are aftereffects of a 
wrong prefix (local/) used when 
creating the virtualenv. Please check you ~/.pydistutils.cfg if you've set it 
to something like that.

Original comment by leidel on 28 Mar 2009 at 1:32

GoogleCodeExporter commented 9 years ago
@leidel, thanks for reply. I have no ~/.pydistutils.cfg at all.

Original comment by khame...@gmail.com on 28 Mar 2009 at 5:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Also, after step 10 I've got OK and django is indeed in my virtualenv:

pinax-env$ find . -name django
./local/lib/python2.6/dist-packages/django

However it is somehow "not seen" by python after the virtualenv activation:

pinax-env$ python
Python 2.6.1+ (r261:67515, Mar 27 2009, 19:05:06)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django.conf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named django.conf
>>> import django
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named django
>>>

For those who cares, it remains so after *successfull* applying:

 sudo pip install --requirement src/pinax/requirements/external_apps.txt

Original comment by khame...@gmail.com on 28 Mar 2009 at 5:45

GoogleCodeExporter commented 9 years ago
@leidel, I have neither system-wide nor local´/user distutils.cfg file. What I 
see is  
that the file is created by a pinax' bootstrapper script:

...
Testing executable with pinax-env/bin/python -c "import sys; print sys.prefix"
Got sys.prefix result: '/mnt/hdd2/pinooblet/pinax-env'
Creating pinax-env/lib/python2.6/distutils
Writing pinax-env/lib/python2.6/distutils/__init__.py
Writing pinax-env/lib/python2.6/distutils/distutils.cfg
No Setuptools egg found; downloading
Installing setuptools...
  Downloading http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-
py2.6.egg
  error: can't create or remove files in install directory
  The following error occurred while trying to add or remove files in the
  installation directory:
      [Errno 2] No such file or directory: '/mnt/hdd2/pinooblet/pinax-
env/local/lib/python2.6/dist-packages/test-easy-install-4035.pth'
  The installation directory you specified (via --install-dir, --prefix, or
  the distutils default setting) was:
      /mnt/hdd2/pinooblet/pinax-env/local/lib/python2.6/dist-packages/
  This directory does not currently exist.  Please create it and try again, or

and after this one can see the first references to "/local/". The created 
distutils.cfg file contains by the way only commented lines and has no 
references to 
whatever containing "/local/"

Original comment by khame...@gmail.com on 29 Mar 2009 at 12:06

GoogleCodeExporter commented 9 years ago
UPDATE: I have successfully passed both the pinax-boot.py phase and the "pip 
install 
--requirements ..." with the following distutils.cfg:

[install]
install-base=/mnt/hdd2/pinooblet/pinax-env/lib/python2.6
install-purelib=/mnt/hdd2/pinooblet/pinax-env/lib/python2.6/site-packages
install-platlib=/mnt/hdd2/pinooblet/pinax-env/lib.$PLAT/python2.6/site-packages
install-scripts=/mnt/hdd2/pinooblet/pinax-env/bin
install-data=/mnt/hdd2/pinooblet/pinax-env/share
install-headers=/mnt/hdd2/pinooblet/pinax-env/include/python2.6

I don't think this configuration is indeed healthy, so, gurus, your healing 
touch is 
welcome. 

for example during "pip install --requirements externalapps.txt" it is reported 
that 
django-notification is already installed. False. It is not installed in virtual 
env, 
but in the global/host environment only.

Original comment by khame...@gmail.com on 30 Mar 2009 at 10:27