0

I'm relatively new to Python, Django and Heroku. I'm attempting to follow the instructions on setting up a Django Heroku project found here. I'm getting stuck at the following command:

$ pip install django-toolbelt

I get the following error

Requirement already satisfied (use --upgrade to upgrade): django-toolbelt in c:\
django\contactmanager\venv\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): django in c:\django\co
ntactmanager\venv\lib\site-packages (from django-toolbelt)
Downloading/unpacking psycopg2 (from django-toolbelt)
  Running setup.py egg_info for package psycopg2

Downloading/unpacking gunicorn (from django-toolbelt)
  Running setup.py egg_info for package gunicorn

    warning: no previously-included files matching '*.pyc' found under directory
 'docs'
    warning: no previously-included files matching '*.pyo' found under directory
 'docs'
    warning: no previously-included files matching '*.pyc' found under directory
 'tests'
    warning: no previously-included files matching '*.pyo' found under directory
 'tests'
    warning: no previously-included files matching '*.pyc' found under directory
 'examples'
    warning: no previously-included files matching '*.pyo' found under directory
 'examples'
Downloading/unpacking dj-database-url (from django-toolbelt)
  Running setup.py egg_info for package dj-database-url

Downloading/unpacking dj-static (from django-toolbelt)
  Running setup.py egg_info for package dj-static

Downloading/unpacking static (from dj-static->django-toolbelt)
  Running setup.py egg_info for package static

Downloading/unpacking pystache (from static->dj-static->django-toolbelt)
  Running setup.py egg_info for package pystache
    pystache: using: version '0.6' of <module 'setuptools' from 'C:\Django\conta
ctmanager\venv\lib\site-packages\distribute-0.6.34-py2.7.egg\setuptools\__init__
.pyc'>

Installing collected packages: psycopg2, gunicorn, dj-database-url, dj-static, s
tatic, pystache
  Running setup.py install for psycopg2
    building 'psycopg2._psycopg' extension
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Django\contactmanager\venv\build\psycopg2\setup.py", line 568, in
 <module>
        ext_modules=ext)
      File "C:\Python27\Lib\distutils\core.py", line 152, in setup
        dist.run_commands()
      File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "C:\Django\contactmanager\venv\lib\site-packages\distribute-0.6.34-py
2.7.egg\setuptools\command\install.py", line 53, in run
        return _install.run(self)
      File "C:\Python27\Lib\distutils\command\install.py", line 563, in run
        self.run_command('build')
      File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "C:\Python27\Lib\distutils\command\build.py", line 127, in run
        self.run_command(cmd_name)
      File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "C:\Python27\Lib\distutils\command\build_ext.py", line 337, in run
        self.build_extensions()
      File "C:\Python27\Lib\distutils\command\build_ext.py", line 446, in build_
extensions
        self.build_extension(ext)
      File "C:\Django\contactmanager\venv\build\psycopg2\setup.py", line 284, in
 build_extension
        build_ext.build_extension(self, extension)
      File "C:\Python27\Lib\distutils\command\build_ext.py", line 496, in build_
extension
        depends=ext.depends)
      File "C:\Python27\Lib\distutils\msvc9compiler.py", line 473, in compile
        self.initialize()
      File "C:\Python27\Lib\distutils\msvc9compiler.py", line 383, in initialize

        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "C:\Python27\Lib\distutils\msvc9compiler.py", line 299, in query_vcva
rsall
        raise ValueError(str(list(result.keys())))
    ValueError: [u'path']
    Complete output from command C:\Django\contactmanager\venv\Scripts\python.ex
e -c "import setuptools;__file__='C:\\Django\\contactmanager\\venv\\build\\psyco
pg2\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file_
_, 'exec'))" install --record c:\users\hp\appdata\local\temp\pip-ka3mfj-record\i
nstall-record.txt --single-version-externally-managed --install-headers C:\Djang
o\contactmanager\venv\include\site\python2.7:
    running install

running build

running build_py

running build_ext

building 'psycopg2._psycopg' extension

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\Django\contactmanager\venv\build\psycopg2\setup.py", line 568, in <mo
dule>

    ext_modules=ext)

  File "C:\Python27\Lib\distutils\core.py", line 152, in setup

    dist.run_commands()

  File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Django\contactmanager\venv\lib\site-packages\distribute-0.6.34-py2.7.
egg\setuptools\command\install.py", line 53, in run

    return _install.run(self)

  File "C:\Python27\Lib\distutils\command\install.py", line 563, in run

    self.run_command('build')

  File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Python27\Lib\distutils\command\build.py", line 127, in run

    self.run_command(cmd_name)

  File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Python27\Lib\distutils\command\build_ext.py", line 337, in run

    self.build_extensions()

  File "C:\Python27\Lib\distutils\command\build_ext.py", line 446, in build_exte
nsions

    self.build_extension(ext)

  File "C:\Django\contactmanager\venv\build\psycopg2\setup.py", line 284, in bui
ld_extension

    build_ext.build_extension(self, extension)

  File "C:\Python27\Lib\distutils\command\build_ext.py", line 496, in build_exte
nsion

    depends=ext.depends)

  File "C:\Python27\Lib\distutils\msvc9compiler.py", line 473, in compile

    self.initialize()

  File "C:\Python27\Lib\distutils\msvc9compiler.py", line 383, in initialize

    vc_env = query_vcvarsall(VERSION, plat_spec)

  File "C:\Python27\Lib\distutils\msvc9compiler.py", line 299, in query_vcvarsal
l

    raise ValueError(str(list(result.keys())))

ValueError: [u'path']

----------------------------------------
Command C:\Django\contactmanager\venv\Scripts\python.exe -c "import setuptools;_
_file__='C:\\Django\\contactmanager\\venv\\build\\psycopg2\\setup.py';exec(compi
le(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --re
cord c:\users\hp\appdata\local\temp\pip-ka3mfj-record\install-record.txt --singl
e-version-externally-managed --install-headers C:\Django\contactmanager\venv\inc
lude\site\python2.7 failed with error code 1 in C:\Django\contactmanager\venv\bu
ild\psycopg2
Storing complete log in C:\Users\hp\pip\pip.log

According to this link I'm supposed to install python-dev, python-psycopg2, libpq-dev before installing django-toolbelt.

I'm on a Windows machine. How can I install these dependencies? I tried installing them with pip but that doesn't work.

2 Answers 2

4

Apparently psycopg2 installers do not work under a virtualenv environment. I downloaded an executable binary from http://stickpeople.com/projects/python/win-psycopg/

To install the native binary in a virtual envrionment, use easy_install:

C:\virtualenv\Scripts\> activate.bat
(virtualenv) C:\virtualenv\Scripts\> easy_install psycopg2-2.5.win32-py2.7-pg9.2.4-release.exe
Sign up to request clarification or add additional context in comments.

Comments

0

This blog post seems useful for your case:

http://www.swarley.me.uk/blog/2014/02/24/create-a-django-development-environment-on-64-bit-windows-for-heroku-deployment/

Or you can just find the windows ports for these dependency packages.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.