OSError setuptools pip failed with error code 1



  • I'm trying to run the Django project on my laptop (Debian 8.5), but the implementation makefile is completed as follows

    virtualenv oscar
    Running virtualenv with interpreter /usr/bin/python2
    New python executable in oscar/bin/python2
    Not overwriting existing python script oscar/bin/python (you must use oscar/bin/python2)
    Installing setuptools, pip...
      Complete output from command /home/miha/opt/osdj/oscar/bin/python2 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
      Exception in thread Thread-2:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
        self.run()
      File "/usr/lib/python2.7/threading.py", line 763, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 245, in _get_queued_page
        page = self._get_page(location, req)
      File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 335, in _get_page
        return HTMLPage.get_page(link, req, cache=self.cache)
      File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 452, in get_page
        resp = urlopen(url)
      File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 85, in __call__
        response = urllib2.urlopen(self.get_request(url))
      File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
        return opener.open(url, data, timeout)
      File "/usr/lib/python2.7/urllib2.py", line 423, in open
        protocol = req.get_type()
      File "/usr/lib/python2.7/urllib2.py", line 285, in get_type
        raise ValueError, "unknown url type: %s" % self.__original
    ValueError: unknown url type: /usr/lib/python3/dist-packages
    

    Exception in thread Thread-3:
    Traceback (most recent call last):
    File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
    File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
    File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 245, in _get_queued_page
    page = self._get_page(location, req)
    File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 335, in _get_page
    return HTMLPage.get_page(link, req, cache=self.cache)
    File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 452, in get_page
    resp = urlopen(url)
    File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 85, in call
    response = urllib2.urlopen(self.get_request(url))
    File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
    File "/usr/lib/python2.7/urllib2.py", line 423, in open
    protocol = req.get_type()
    File "/usr/lib/python2.7/urllib2.py", line 285, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
    ValueError: unknown url type: /usr/share/python-wheels/
    Exception in thread Thread-1:
    Traceback (most recent call last):
    File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
    File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
    File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 245, in _get_queued_page
    page = self._get_page(location, req)
    File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 335, in _get_page
    return HTMLPage.get_page(link, req, cache=self.cache)
    File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 452, in get_page
    resp = urlopen(url)
    File "/home/miha/opt/osdj/oscar/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 85, in call
    response = urllib2.urlopen(self.get_request(url))
    File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
    File "/usr/lib/python2.7/urllib2.py", line 423, in open
    protocol = req.get_type()
    File "/usr/lib/python2.7/urllib2.py", line 285, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
    ValueError: unknown url type: .

    Ignoring indexes: http://pypi.python.org/simple/
    Downloading/unpacking distribute
    Could not find any downloads that satisfy the requirement distribute
    No distributions at all found for distribute
    Storing complete log in /root/.pip/pip.log

    ...Installing setuptools, pip...done.
    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/virtualenv.py", line 2378, in <module>
    main()
    File "/usr/lib/python3/dist-packages/virtualenv.py", line 830, in main
    symlink=options.symlink)
    File "/usr/lib/python3/dist-packages/virtualenv.py", line 1032, in create_environment
    install_wheel(to_install, py_executable, search_dirs)

    File "/usr/lib/python3/dist-packages/virtualenv.py", line 975, in install_wheel
    'PIP_NO_INDEX': '1'
    File "/usr/lib/python3/dist-packages/virtualenv.py", line 917, in call_subprocess
    % (cmd_desc, proc.returncode))
    OSError: Command /home/miha/opt/osdj/oscar/bin/python2 -c "import sys, pip; sys...d"] + sys.argv[1:]))" setuptools pip failed with error code 1
    Makefile:13: ошибка выполнения рецепта для цели «libs»
    make: *** [libs] Ошибка 1

    From the hygienics, there were options that the piton version was old, but I have 2.7.9 (this decision proposed to be updated). It was also an option that the pitone versions in the mix were more appropriate. But at my request, "python" gives the right 2.7.9 for the project. And asking for python3 isn't the right third. The code makes mistakes python3, but I don't understand where and what to do with it. Code makefile

    # These targets are not files
    .PHONY: libs install start stop

    NAME = chem
    CTX = prod
    PORT = 80
    DOMAIN = 127.0.0.1

    DJANGO_SETTINGS_MODULE = $(NAME).settings.$(CTX)
    export DJANGO_SETTINGS_MODULE

    libs:
    aptitude -y install python-pip python-dev build-essential python-virtualenv libjpeg-dev daemon nginx uwsgi uwsgi-plugin-python git libmysqlclient-dev

    virtualenv oscar
    oscar/bin/pip install django-oscar==1.1.1 pysolr simplejson xlrd MySQL-python 
    oscar/bin/pip uninstall -y Pillow
    oscar/bin/pip install Pillow
    
    rm -rf solr-4.7.2
    wget -q http://archive.apache.org/dist/lucene/solr/4.7.2/solr-4.7.2.tgz -O solr-4.7.2.tgz   
    tar xzf solr-4.7.2.tgz
    mv solr-4.7.2/example/solr/collection1/conf solr-4.7.2/example/solr/collection1/conf.original
    mkdir solr-4.7.2/example/solr/collection1/conf
    cp -rp solr.conf/* solr-4.7.2/example/solr/collection1/conf
    

    git clone https://Ilya_tt@bitbucket.org/Ilya_tt/chem.git

    change chem/settings/prod.py MYSQL

    install:
    python confgen.py $(NAME) $(CTX) $(DOMAIN) $(PORT)

    rm -rf /etc/nginx/sites-enabled/$(NAME)_nginx.conf
    rm -rf /etc/uwsgi/apps-enabled/$(NAME)_uwsgi.ini
    
    ln -s $(shell pwd)/$(NAME)_nginx.conf /etc/nginx/sites-enabled/
    ln -s $(shell pwd)/$(NAME)_uwsgi.ini /etc/uwsgi/apps-enabled/
    
    chmod 744 solr.run  
    chown -R www-data pid
    chgrp -R www-data pid   
    chown -R www-data logs
    chgrp -R www-data logs
    chown -R www-data $(NAME)/public
    chgrp -R www-data $(NAME)/public
    
    oscar/bin/python $(NAME)/manage.py migrate
    oscar/bin/python $(NAME)/manage.py loaddata init
    oscar/bin/python $(NAME)/manage.py loaddata flatpage
    oscar/bin/python $(NAME)/manage.py loaddata offer
    oscar/bin/python $(NAME)/manage.py collectstatic --noinput
    
    chown -R www-data $(NAME)/public
    chgrp -R www-data $(NAME)/public
    

    static:
    oscar/bin/python $(NAME)/manage.py collectstatic --noinput

    start:
    ./solr.run start
    service uwsgi restart

    stop:
    service uwsgi stop
    ./solr.run stop

    The question is, what should we do to avoid this mistake?

    dpkg -l - grep wheel
    ii python-setuptools-whl 5.5.1-1 all Python Distutils Enhancements (wheel package)
    ii python-six-whl 1.8.0-1 all Python 2 and 3 compatibility library (universal wheel)
    ii python-wheel 0.24.0-1 all built-package format for Python



  • There was a mistake in the team.

    virtualenv oscar
    

    There was a oscar folder in this folder, deleted it.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2