Permission denied when trying to install inside a virtualenv using ansible - ansible

I have this play in my ansible playbook
- name: Setup virtualenv
pip:
requirements="/vagrant/webapp/requirements/{{ requirements_filename }}"
virtualenv="$HOME/.envs/{{ project_name }}"
However, I am receiving a Permission denied error. It seems like ansible is trying to install the package into the system path and not into the virtualenv.
Here's the full traceback:
TASK: [deploy | Setup virtualenv] *********************************************
failed: [default] => {"cmd": "/usr/bin/pip install -r /vagrant/webapp/requirements/dev.txt", "failed": true}
msg: stdout: New python executable in /home/vagrant/.envs/venv/bin/python
Installing setuptools, pip...done.
Downloading/unpacking django>=1.8 (from -r /vagrant/webapp/requirements/requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): wsgiref>=0.1.2 in /usr/lib/python2.7 (from -r /vagrant/webapp/requirements/requirements.txt (line 4))
Downloading/unpacking django-allauth>=0.19.1 (from -r /vagrant/webapp/requirements/requirements.txt (line 5))
Running setup.py (path:/tmp/pip_build_vagrant/django-allauth/setup.py) egg_info for package django-allauth
Downloading/unpacking psycopg2>=2.6 (from -r /vagrant/webapp/requirements/requirements.txt (line 6))
Running setup.py (path:/tmp/pip_build_vagrant/psycopg2/setup.py) egg_info for package psycopg2
Downloading/unpacking django-currencies>=0.3.3 (from -r /vagrant/webapp/requirements/requirements.txt (line 7))
Downloading django-currencies-0.3.3.tar.gz
Running setup.py (path:/tmp/pip_build_vagrant/django-currencies/setup.py) egg_info for package django-currencies
Downloading/unpacking django-countries>=3.2 (from -r /vagrant/webapp/requirements/requirements.txt (line 8))
Running setup.py (path:/tmp/pip_build_vagrant/django-countries/setup.py) egg_info for package django-countries
Downloading/unpacking stripe>=1.22.1 (from -r /vagrant/webapp/requirements/requirements.txt (line 9))
Running setup.py (path:/tmp/pip_build_vagrant/stripe/setup.py) egg_info for package stripe
Downloading/unpacking pillow>=2.8.0 (from -r /vagrant/webapp/requirements/requirements.txt (line 10))
Running setup.py (path:/tmp/pip_build_vagrant/pillow/setup.py) egg_info for package pillow
Single threaded build, not installing mp_compile: 1 processes
warning: no files found matching 'LICENSE' under directory 'docs'
Downloading/unpacking django-compressor>=1.4 (from -r /vagrant/webapp/requirements/requirements.txt (line 11))
Downloading/unpacking djangorestframework>=3.1.1 (from -r /vagrant/webapp/requirements/requirements.txt (line 12))
Downloading/unpacking django-filter>=0.9.2 (from -r /vagrant/webapp/requirements/requirements.txt (line 13))
Downloading django_filter-0.9.2-py2.py3-none-any.whl
Obtaining formtools from git+https://github.com/django/django-formtools.git#egg=formtools (from -r /vagrant/webapp/requirements/requirements.txt (line 14))
Cloning https://github.com/django/django-formtools.git to ./src/formtools
Running setup.py (path:/tmp/src/formtools/setup.py) egg_info for package formtools
Installing extra requirements: 'egg'
Downloading/unpacking django-widget-tweaks>=1.3 (from -r /vagrant/webapp/requirements/requirements.txt (line 15))
Downloading django-widget-tweaks-1.3.tar.gz
Running setup.py (path:/tmp/pip_build_vagrant/django-widget-tweaks/setup.py) egg_info for package django-widget-tweaks
Downloading/unpacking django-braces>=1.4.0 (from -r /vagrant/webapp/requirements/requirements.txt (line 16))
Downloading django_braces-1.4.0-py2.py3-none-any.whl
Downloading/unpacking django-debug-toolbar>=1.3.0 (from -r /vagrant/webapp/requirements/dev.txt (line 4))
Downloading/unpacking python-openid>=2.2.5 (from django-allauth>=0.19.1->-r /vagrant/webapp/requirements/requirements.txt (line 5))
Running setup.py (path:/tmp/pip_build_vagrant/python-openid/setup.py) egg_info for package python-openid
warning: no files found matching 'CHANGELOG'
warning: no files found matching '*.css' under directory 'doc'
warning: no files found matching '*.html' under directory 'doc'
Downloading/unpacking requests-oauthlib>=0.3.0 (from django-allauth>=0.19.1->-r /vagrant/webapp/requirements/requirements.txt (line 5))
Downloading requests_oauthlib-0.4.2-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): requests>=1.0.3 in /usr/lib/python2.7/dist-packages (from django-allauth>=0.19.1->-r /vagrant/webapp/requirements/requirements.txt (line 5))
Downloading/unpacking django-appconf>=0.4 (from django-compressor>=1.4->-r /vagrant/webapp/requirements/requirements.txt (line 11))
Downloading django_appconf-1.0.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from django-braces>=1.4.0->-r /vagrant/webapp/requirements/requirements.txt (line 16))
Downloading/unpacking sqlparse (from django-debug-toolbar>=1.3.0->-r /vagrant/webapp/requirements/dev.txt (line 4))
Running setup.py (path:/tmp/pip_build_vagrant/sqlparse/setup.py) egg_info for package sqlparse
Downloading/unpacking oauthlib>=0.6.2 (from requests-oauthlib>=0.3.0->django-allauth>=0.19.1->-r /vagrant/webapp/requirements/requirements.txt (line 5))
Running setup.py (path:/tmp/pip_build_vagrant/oauthlib/setup.py) egg_info for package oauthlib
Installing collected packages: django, django-allauth, psycopg2, django-currencies, django-countries, stripe, pillow, django-compressor, djangorestframework, django-filter, formtools, django-widget-tweaks, django-braces, django-debug-toolbar, python-openid, requests-oauthlib, django-appconf, sqlparse, oauthlib
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 206, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 193, in clobber
os.makedirs(destsubdir)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.8.dist-info'
Storing debug log for failure in /home/vagrant/.pip/pip.log
FATAL: all hosts have already failed -- aborting

I solved the problem by setting the path explicitly and not using the $HOME variable.
- name: Setup virtualenv
pip:
virtualenv="/home/vagrant/.envs/{{ project_name }}"
requirements="/vagrant/webapp/requirements/{{ requirements_filename }}"

Try specifying a pip executable path as well:
executable="$HOME/.envs/{{ project_name }}/bin/pip"
Didn't search for an exact reason TBH, but had to do the same to get stuff installed into virtual environments. Seemed like it tried to install into a virtual environment using global pip. Maybe that's possible to do under some circumstances, wasn't my case.

It seems the pip module is using the system Python so it will try and install the package on the expected system path to site-packages and since you're not running this as root or using sudo it can't write to '/usr/local/lib/python2.7/...'
I'm assuming you want to install the pip package under the virtualenv, correct?
If so beware that Ansible modules always use, by default, the system default Python interpreter unless you set ansible_python_interpreter.
An example of how to do this can be found on Best way to always run ansible inside a virtualenv on remote machines?
A link to a short discussion about the subject and why Ansible people don't want to change #!/usr/bin/python for the more virtualenv-friendly #!/usr/bin/env python can be found here.
As a note you'll have the same problem if you're running Ansible from a local virtualenv and try and use say ec2 module without having boto installed at the system-level (but installed at the virtualenv level).

Looks like it is using /usr/bin/pip, not pip from virtualenv. Not sure why this happens - a bug in Ansible? Can you manually check your virtualenv has pip command? One thing I can think out from my head pip is created for root (sudo) and you try to run the command as a normal user and it doesn't have read access to virtualenv'ed pip.
You can probably use pip manually like this for workaround.
- name: Create virtualenv for app using chosen Python
shell: virtualenv --python=python3.4 {{deploy_location}}/venv
sudo: yes
- name: Install Python packages
sudo: yes
command: {{deploy_location}}/venv/bin/pip -r {{deploy_location}}/requirements.txt

Related

Install PANDAS on Mac, big issue

I lot of people had asked this question, but I can't find an answer that can help me overcome my problems installing PANDAS on my Mac.
I've tried several procedures previously suggested, but they don't work. This is the error I'm getting.
Pablos-MacBook-Pro:pastudilloe$ sudo pip install pandas
The directory '/Users/pastudilloe/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/pastudilloe/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pandas
Downloading https://files.pythonhosted.org/packages/58/9a/f571a032f5f2bf5b8a5d63ce079428c5423299853ed2d8d96626f441801d/pandas-0.23.3-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (14.6MB)
100% |████████████████████████████████| 14.6MB 83kB/s
Collecting numpy>=1.9.0 (from pandas)
Downloading https://files.pythonhosted.org/packages/3c/bf/e36756c562f7386be78c6942f0a8a647ee4eb374cdf219bece7054832b14/numpy-1.15.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (24.5MB)
100% |████████████████████████████████| 24.5MB 49kB/s
Collecting python-dateutil>=2.5.0 (from pandas)
Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)
100% |████████████████████████████████| 215kB 640kB/s
Requirement already satisfied: pytz>=2011k in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pandas)
Requirement already satisfied: six>=1.5 in /Users/pastudilloe/Library/Python/2.7/lib/python/site-packages (from python-dateutil>=2.5.0->pandas)
Installing collected packages: numpy, python-dateutil, pandas
Found existing installation: numpy 1.8.0rc1
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling numpy-1.8.0rc1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-62NbGp-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
uninstall numpy and then try again:
pip uninstall numpy
pip install pandas
In the ipython jupyter code,
Add below lines
!pip install pandas
!pip install numpy
It will be installed during runtime if it is not installed.

How can I install Ansible on Raspbian?

I would like to install Ansible on my Raspberry Pi (raspbian/jessie) so that I can maintain it. Unfortunately, I don't seem to be able to install it. I've tried APT and PIP so far but each has a hurdle.
APT
pi#retropie:~ $ sudo apt-add-repository ppa:ansible/ansible
Traceback (most recent call last):
File "/usr/bin/apt-add-repository", line 167, in <module>
sp = SoftwareProperties(options=options)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 105, in __init__
self.reload_sourceslist()
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 595, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/jessie
PIP (Python 2.7.9, pip 1.5.6)
pi#retropie:~ $ sudo pip install ansible
Downloading/unpacking ansible
Downloading ansible-2.4.1.0.tar.gz (6.7MB): 6.7MB downloaded
no previously-included directories found matching 'ticket_stubs'
no previously-included directories found matching 'hacking'
Downloading/unpacking jinja2 (from ansible)
Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB): 340kB downloaded
Downloading/unpacking PyYAML (from ansible)
Downloading PyYAML-3.12.tar.gz (253kB): 253kB downloaded
Running setup.py (path:/tmp/pip-build-bsUTB2/PyYAML/setup.py) egg_info for package PyYAML
Downloading/unpacking paramiko (from ansible)
Downloading paramiko-2.3.1-py2.py3-none-any.whl (182kB): 182kB downloaded
Downloading/unpacking cryptography (from ansible)
Downloading cryptography-2.1.2.tar.gz (441kB): 441kB downloaded
Running setup.py (path:/tmp/pip-build-bsUTB2/cryptography/setup.py) egg_info for package cryptography
error in cryptography setup command: Invalid environment marker: python_version < '3'
Complete output from command python setup.py egg_info:
error in cryptography setup command: Invalid environment marker: python_version < '3'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-bsUTB2/cryptography
Storing debug log for failure in /root/.pip/pip.log
Python 3
As you can see from the above error, "cryptography" indicates it needs > python3
I looked at the installation requirements and found that you need python 3.5+ if you use 3. Rasbian comes with 3.4...
I then tried to get python 3.6 installed using a couple of ppa's (ppa:jonathonf/python-3.6 and ppa:deadsnakes/ppa) but there aren't distros available for raspbian/jessie either.
After that I started looking at pulling down and compiling python from source but I'm expecting I'll hit another hurdle.
Ugh...
In summary, does anyone have any ideas how I can get Ansible installed on a Raspberry Pi?
Slightly old question but its the first result that comes up when googling for how to install Ansible on Raspbian so thought I'd update it. If you're running stretch (or stretch-lite)
You can just do
sudo apt-get install ansible
However currently the version of Ansbile in the Raspbian repositories is 2.2 which is a little old
Following instructions (with a little modification to overcome some errors) from the Ansible installation page you can do the following:
First run
sudo apt-get install dirmngr
Edit your /etc/apt/sources.list and append
deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main
then run
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
sudo apt-get update
sudo apt-get install ansible
This will give you version 2.7.8 as of today.
Edited to include missing command (thanks SpacePope) and correct formatting.
Jessie was released in 2015 and is officially obsolete. Stretch is the current Raspbian repo, and it has python3.5 without adding PPAs.
You can then simply install Ansible with pip3.

"python setup.py egg_info" failed with error code 1 when installing autosub

I tried to install Autosub but it shown error, and I cannot find a solution that work for me.
I already installed ffmpeg that required by Autosub and added path for it.
I also upgraded my setuptools.
C:\WINDOWS\system32>pip install autosub
Collecting autosub
Using cached autosub-0.3.11.tar.gz
Collecting google-api-python-client>=1.4.2 (from autosub)
Using cached google_api_python_client-1.6.2-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.3.0 in c:\program files\python36\lib\site-packages (from autosub)
Collecting pysrt>=1.0.1 (from autosub)
Using cached pysrt-1.1.1.tar.gz
Collecting progressbar>=2.3 (from autosub)
Using cached progressbar-2.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\setup.py", line 5, in <module>
import progressbar
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\progressbar\__init__.py", line 59, in <module>
from progressbar.widgets import *
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\progressbar\widgets.py", line 121, in <module>
class FileTransferSpeed(Widget):
File "c:\program files\python36\lib\abc.py", line 133, in __new__
cls = super().__new__(mcls, name, bases, namespace)
ValueError: 'format' in __slots__ conflicts with class variable
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\
I found another answer that said enter easy_install -U setuptools but shown error too. (cmd is run as admin)
C:\WINDOWS\system32>easy_install -U setuptools
Searching for setuptools
Reading https://pypi.python.org/simple/setuptools/
Best match: setuptools 35.0.1
Processing setuptools-35.0.1-py3.6.egg
setuptools 35.0.1 is already the active version in easy-install.pth
Installing easy_install-script.py script to c:\program files\python36\Scripts
Installing easy_install.exe script to c:\program files\python36\Scripts
error: [WinError 5] Access is denied: 'c:\\program files\\python36\\Scripts\\easy_install.exe'
Any help would be appreciated.
-Error install pip
"python setup.py egg_info"
Solution
Install Python 2.7 uninstall 3.x
https://github.com/agermanidis/autosub/issues/31
If you run into this problem while running an Alpine Docker container, which was the case for me. Try adding the following line to your Dockerfile to install required dependencies.
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev

pip installs a django version different from the one specified in requirements.txt

I'm trying to do the djangocms tutorial.
Everything is fine on my laptop (on Archlinux), but I tried to continue the project on a different computer (using Mac OS X).
I made my git clone, started a fresh virtualenv and tried to do a pip install -r requirements.txt.
Here is the content of my requirements.txt (I got it from a pip freeze output) :
dj-database-url==0.3.0
Django==1.6.11
django-classy-tags==0.6.2
django-cms==3.1.2
django-reversion==1.8.5
django-sekizai==0.8.2
Django-Select2==4.3.1
django-treebeard==3.0
djangocms-admin-style==0.2.7
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.2
djangocms-inherit==0.1
djangocms-installer==0.7.8
djangocms-link==1.6.2
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.5.2
djangocms-video==0.1
html5lib==0.99999
Pillow==2.8.0
-e git+http://git#github.com/divio/django-polls.git#9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da#egg=polls-master
pytz==2015.4
six==1.9.0
South==1.0.2
tzlocal==1.2
wheel==0.24.0
But the django version after the pip install is Django 1.7.4 (instead of Django 1.6.11).
And I don't understand why.
Here is the output of a pip freeze :
dj-database-url==0.3.0
Django==1.7.4
django-classy-tags==0.6.2
django-cms==3.1.2
django-reversion==1.8.5
django-sekizai==0.8.2
Django-Select2==4.3.1
django-treebeard==3.0
djangocms-admin-style==0.2.7
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.2
djangocms-inherit==0.1
djangocms-installer==0.7.8
djangocms-link==1.6.2
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.5.2
djangocms-video==0.1
html5lib==0.99999
pbr==0.10.7
Pillow==2.8.0
-e git+http://git#github.com/divio/django-polls.git#9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da#egg=polls-master
pytz==2015.4
six==1.9.0
South==1.0.2
stevedore==1.2.0
tzlocal==1.2
virtualenv==13.1.0
virtualenv-clone==0.2.5
virtualenvwrapper==4.6.0
wheel==0.24.0
Here is the output of the pip install -r requirements.txt :
/Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting dj-database-url==0.3.0 (from -r requirements.txt (line 1))
/Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading dj_database_url-0.3.0-py2.py3-none-any.whl
Collecting Django==1.6.11 (from -r requirements.txt (line 2))
Downloading Django-1.6.11-py2.py3-none-any.whl (6.7MB)
100% |████████████████████████████████| 6.7MB 75kB/s
Collecting django-classy-tags==0.6.2 (from -r requirements.txt (line 3))
Downloading django_classy_tags-0.6.2-py2-none-any.whl
Collecting django-cms==3.1.2 (from -r requirements.txt (line 4))
Downloading django_cms-3.1.2-py2.py3-none-any.whl (3.0MB)
100% |████████████████████████████████| 3.0MB 150kB/s
Collecting django-reversion==1.8.5 (from -r requirements.txt (line 5))
Downloading django-reversion-1.8.5.tar.gz (57kB)
100% |████████████████████████████████| 61kB 4.1MB/s
Collecting django-sekizai==0.8.2 (from -r requirements.txt (line 6))
Downloading django_sekizai-0.8.2-py2.py3-none-any.whl
Collecting Django-Select2==4.3.1 (from -r requirements.txt (line 7))
Downloading Django-Select2-4.3.1.tar.gz (97kB)
100% |████████████████████████████████| 98kB 3.0MB/s
Collecting django-treebeard==3.0 (from -r requirements.txt (line 8))
Downloading django-treebeard-3.0.tar.gz (93kB)
100% |████████████████████████████████| 94kB 1.8MB/s
Collecting djangocms-admin-style==0.2.7 (from -r requirements.txt (line 9))
Downloading djangocms_admin_style-0.2.7-py2.py3-none-any.whl (484kB)
100% |████████████████████████████████| 487kB 834kB/s
Collecting djangocms-column==1.5 (from -r requirements.txt (line 10))
Downloading djangocms_column-1.5-py2-none-any.whl (127kB)
100% |████████████████████████████████| 131kB 1.7MB/s
Collecting djangocms-file==0.1 (from -r requirements.txt (line 11))
Downloading djangocms_file-0.1-py2-none-any.whl (120kB)
100% |████████████████████████████████| 122kB 2.8MB/s
Collecting djangocms-flash==0.2.0 (from -r requirements.txt (line 12))
Downloading djangocms_flash-0.2.0-py2-none-any.whl (121kB)
100% |████████████████████████████████| 122kB 3.9MB/s
Collecting djangocms-googlemap==0.2 (from -r requirements.txt (line 13))
Downloading djangocms_googlemap-0.2-py2-none-any.whl (193kB)
100% |████████████████████████████████| 196kB 2.4MB/s
Collecting djangocms-inherit==0.1 (from -r requirements.txt (line 14))
Downloading djangocms_inherit-0.1-py2-none-any.whl (131kB)
100% |████████████████████████████████| 135kB 2.5MB/s
Collecting djangocms-installer==0.7.8 (from -r requirements.txt (line 15))
Downloading djangocms_installer-0.7.8-py2.py3-none-any.whl (47kB)
100% |████████████████████████████████| 49kB 3.9MB/s
Collecting djangocms-link==1.6.2 (from -r requirements.txt (line 16))
Downloading djangocms_link-1.6.2-py2-none-any.whl (151kB)
100% |████████████████████████████████| 151kB 1.3MB/s
Collecting djangocms-picture==0.1 (from -r requirements.txt (line 17))
Downloading djangocms_picture-0.1-py2-none-any.whl (154kB)
100% |████████████████████████████████| 155kB 2.6MB/s
Collecting djangocms-style==1.5 (from -r requirements.txt (line 18))
Downloading djangocms-style-1.5.tar.gz
Collecting djangocms-teaser==0.1 (from -r requirements.txt (line 19))
Downloading djangocms_teaser-0.1-py2-none-any.whl (121kB)
100% |████████████████████████████████| 122kB 3.0MB/s
Collecting djangocms-text-ckeditor==2.5.2 (from -r requirements.txt (line 20))
Downloading djangocms_text_ckeditor-2.5.2-py2.py3-none-any.whl (1.6MB)
100% |████████████████████████████████| 1.6MB 303kB/s
Collecting djangocms-video==0.1 (from -r requirements.txt (line 21))
Downloading djangocms_video-0.1-py2-none-any.whl (176kB)
100% |████████████████████████████████| 180kB 1.1MB/s
Collecting html5lib==0.99999 (from -r requirements.txt (line 22))
Downloading html5lib-0.99999.tar.gz (887kB)
100% |████████████████████████████████| 888kB 493kB/s
Collecting Pillow==2.8.0 (from -r requirements.txt (line 23))
Downloading Pillow-2.8.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.8MB)
100% |████████████████████████████████| 2.8MB 162kB/s
Obtaining polls-master from git+http://git#github.com/divio/django-polls.git#9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da#egg=polls-master (from -r requirements.txt (line 24))
Cloning http://git#github.com/divio/django-polls.git (to 9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da) to /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/src/polls-master
Could not find a tag or branch '9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da', assuming commit.
Collecting pytz==2015.4 (from -r requirements.txt (line 25))
Downloading pytz-2015.4-py2.py3-none-any.whl (475kB)
100% |████████████████████████████████| 475kB 1.1MB/s
Requirement already satisfied (use --upgrade to upgrade): six==1.9.0 in /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 26))
Collecting South==1.0.2 (from -r requirements.txt (line 27))
Downloading South-1.0.2.tar.gz (96kB)
100% |████████████████████████████████| 98kB 3.3MB/s
Collecting tzlocal==1.2 (from -r requirements.txt (line 28))
Downloading tzlocal-1.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): wheel==0.24.0 in /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/lib/python2.7/site-packages (from -r requirements.txt (line 29))
Requirement already satisfied (use --upgrade to upgrade): argparse in /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages (from djangocms-installer==0.7.8->-r requirements.txt (line 15))
Requirement already satisfied (use --upgrade to upgrade): pip in /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/lib/python2.7/site-packages (from djangocms-installer==0.7.8->-r requirements.txt (line 15))
Building wheels for collected packages: django-reversion, Django-Select2, django-treebeard, djangocms-style, html5lib, South, tzlocal
Running setup.py bdist_wheel for django-reversion
Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/51/b4/ea/033db3e78df246021ef65c216c3f716efd5882021289378705
Running setup.py bdist_wheel for Django-Select2
Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/a7/e2/92/a069a90e2595d4a5dbc9f0609d52d8bea9555e42153828eebb
Running setup.py bdist_wheel for django-treebeard
Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/73/8e/8b/3d72e01575557ffeeb1ef648581006d468a415ed868abbfb5d
Running setup.py bdist_wheel for djangocms-style
Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/5b/80/87/41ea156cdab7a7a170122f3a3b77af473ae855612d4d88d6a2
Running setup.py bdist_wheel for html5lib
Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/44/5c/08/f97a40f63f914c4c3a9798e1ff5606b5ab19fe5dcfb64e27b6
Running setup.py bdist_wheel for South
Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/11/2b/ca/a57966e1943759859dd94f3ebc5c279450bee11e07d600e3a3
Running setup.py bdist_wheel for tzlocal
Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/39/8d/3b/21db6b23bc7483a2e1cf391865427e8fbd090223d9db2cfab3
Successfully built django-reversion Django-Select2 django-treebeard djangocms-style html5lib South tzlocal
Installing collected packages: dj-database-url, Django, django-classy-tags, django-sekizai, django-treebeard, djangocms-admin-style, html5lib, django-cms, django-reversion, Django-Select2, djangocms-column, djangocms-file, djangocms-flash, djangocms-googlemap, djangocms-inherit, pytz, tzlocal, djangocms-installer, djangocms-link, djangocms-picture, djangocms-style, djangocms-teaser, Pillow, djangocms-text-ckeditor, djangocms-video, polls-master, South
Found existing installation: Django 1.7.4
Not uninstalling Django at /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages, outside environment /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms
Running setup.py develop for polls-master
Successfully installed Django-1.7.4 Django-Select2-4.3.1 Pillow-2.8.0 South-1.0.2 dj-database-url-0.3.0 django-classy-tags-0.6.2 django-cms-3.1.2 django-reversion-1.8.5 django-sekizai-0.8.2 django-treebeard-3.0 djangocms-admin-style-0.2.7 djangocms-column-1.5 djangocms-file-0.1 djangocms-flash-0.2.0 djangocms-googlemap-0.2 djangocms-inherit-0.1 djangocms-installer-0.7.8 djangocms-link-1.6.2 djangocms-picture-0.1 djangocms-style-1.5 djangocms-teaser-0.1 djangocms-text-ckeditor-2.5.2 djangocms-video-0.1 html5lib-0.99999 polls-master pytz-2015.4 tzlocal-1.2
Django 1.7.4 seems to be installed at the end.
Why?
How could I avoid this? My current project can't work with this version and the tutorial requires Django 1.6.
EDIT :
I just found out that in the site-packages of my virtualenv, the version of django is 1.6.11. So my virtualenv may use the wrong site-package.
Why?
How could I fix this?
Usually, when we use a virtualenv, shouldn't it use the right site-package directory?
Last 5 lines of the pip install -r requirements.txt output gives you the answer:
Successfully built django-reversion Django-Select2 django-treebeard djangocms-style html5lib South tzlocal
Installing collected packages: dj-database-url, Django, django-classy-tags, django-sekizai, django-treebeard, djangocms-admin-style, html5lib, django-cms, django-reversion, Django-Select2, djangocms-column, djangocms-file, djangocms-flash, djangocms-googlemap, djangocms-inherit, pytz, tzlocal, djangocms-installer, djangocms-link, djangocms-picture, djangocms-style, djangocms-teaser, Pillow, djangocms-text-ckeditor, djangocms-video, polls-master, South
Found existing installation: Django 1.7.4
Not uninstalling Django at /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages, outside environment /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms
Running setup.py develop for polls-master
Successfully installed Django-1.7.4 Django-Select2-4.3.1 Pillow-2.8.0 South-1.0.2 dj-database-url-0.3.0 django-classy-tags-0.6.2 django-cms-3.1.2 django-reversion-1.8.5 django-sekizai-0.8.2 django-treebeard-3.0 djangocms-admin-style-0.2.7 djangocms-column-1.5 djangocms-file-0.1 djangocms-flash-0.2.0 djangocms-googlemap-0.2 djangocms-inherit-0.1 djangocms-installer-0.7.8 djangocms-link-1.6.2 djangocms-picture-0.1 djangocms-style-1.5 djangocms-teaser-0.1 djangocms-text-ckeditor-2.5.2 djangocms-video-0.1 html5lib-0.99999 polls-master pytz-2015.4 tzlocal-1.2
You have Django 1.7.4 installed already:
Found existing installation: Django 1.7.4. I believe that is the reason why Django 1.6.11 is not being installed. Hence the output message: Not uninstalling Django at /Volumes/Data/...
Someone on IRC explained me the problem :
It had to do with my sys.path and my $PYTHONPATH :
I added the main python path (the standard one, without using a virtualenv) in my $PYTHONPATH, so my $PYTHONPATH was added to my sys.path as a prefix, and the django from outside the virtualenv was imported prior to the one inside.
I only had to unset $PYTHONPATH in my ~/.zshrc and it worked like a charm!

Error [Errno 89] Function not implemented while executing command python setup.py egg_info

Update 6/25/2013) I see the same error when trying to install different package using pip, indicating that the package is likely to have nothing to do with the issue.
On QNX I'm seeing the following error upon running pip.
# pip install -U catkin_pkg
Downloading/unpacking catkin-pkg
Running setup.py egg_info for package catkin-pkg
Requirement already up-to-date: argparse in /usr/pkg/lib/python2.7/site-packages (from catkin-pkg)
Requirement already up-to-date: docutils in /usr/pkg/lib/python2.7/site-packages (from catkin-pkg)
Requirement already up-to-date: python-dateutil in /usr/pkg/lib/python2.7/site-packages (from catkin-pkg)
Requirement already up-to-date: six in /usr/pkg/lib/python2.7/site-packages (from python-dateutil->catkin-pkg)
Installing collected packages: catkin-pkg
Running setup.py install for catkin-pkg
Error [Errno 89] Function not implemented while executing command /usr/qnx650/host/qnx6/x86/usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-n130s/catkin-pkg/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-XhRdBe-record/install-record.txt --single-version-externally-managed
Exception:
Traceback (most recent call last):
File "/usr/pkg/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/usr/pkg/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/commands/install.py", line 271, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/pkg/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.py", line 1185, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/pkg/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.py", line 592, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/pkg/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/util.py", line 627, in call_subprocess
cwd=cwd, env=env)
File "/usr/pkg/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/pkg/lib/python2.7/subprocess.py", line 1205, in _execute_child
self.pid = os.fork()
OSError: [Errno 89] Function not implemented
Storing complete log in /root/.pip/pip.log
The first time I ran this command when the depended components such as argparse, docutils, python-dateutil and six were not installed, the same error happened, but at the part where these required components are checked. Now that I've installed them one by one, it seems to be happening at the pkg I'm installing itself (ie. catkin_pkg).
On python's console, os.fork(), which I assume the source of the cause, behaves differently. Thus I'm not even sure if the error occurs at os.fork() or not.
# python
Python 2.7.4 (default, Jun 21 2013, 22:33:48)
[GCC 4.4.2] on qnx6
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.fork()
18804790
>>> 0
sem_wait: Invalid argument
How can I avoid this error? Thank you!
Using QNX 6.5.0 SDP SP1, pip version is 1.3 (its source on github), also source of catkin_pkg.
I somehow figured it out. Running pip WITHOUT -U option gets the package installed (install log is at the bottom for the reference).
...But why...? Help message of pip's doesn't seem to make sense to me:
$ pip install --help
:
Install Options:
:
-U, --upgrade Upgrade all packages to the newest available version. This process is recursive regardless of whether a dependency is already satisfied.
Log of installation by pip:
$ pip install catkin_pkg
Downloading/unpacking catkin-pkg
Running setup.py egg_info for package catkin-pkg
Requirement already satisfied (use --upgrade to upgrade): argparse in /usr/pkg/lib/python2.7/site-packages (from catkin-pkg)
Requirement already satisfied (use --upgrade to upgrade): docutils in /usr/pkg/lib/python2.7/site-packages (from catkin-pkg)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/pkg/lib/python2.7/site-packages (from catkin-pkg)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/pkg/lib/python2.7/site-packages (from python-dateutil->catkin-pkg)
Installing collected packages: catkin-pkg
Running setup.py install for catkin-pkg
changing mode of build/scripts-2.7/catkin_create_pkg from 664 to 775
changing mode of build/scripts-2.7/catkin_generate_changelog from 664 to 775
changing mode of build/scripts-2.7/catkin_tag_changelog from 664 to 775
changing mode of build/scripts-2.7/catkin_test_changelog from 664 to 775
changing mode of /usr/pkg/bin/catkin_create_pkg to 775
changing mode of /usr/pkg/bin/catkin_generate_changelog to 775
changing mode of /usr/pkg/bin/catkin_tag_changelog to 775
changing mode of /usr/pkg/bin/catkin_test_changelog to 775
Successfully installed catkin-pkg
Cleaning up...

Resources