Error while trying to install cassandra-driver using python(on Windows)

582 views
Skip to first unread message

Shiva Dasari

unread,
May 15, 2017, 2:49:19 PM5/15/17
to DataStax Python Driver for Apache Cassandra User Mailing List

I'm trying to install cassandra-driver using python(on windows) but it fails with following exception. could someone please help me on this,

I have also tried the manual installation process mentioned at following location & its same error,http://datastax.github.io/python-driver/installation.html


Installation Exception:
C:\Windows\System32>pip install cassandra-driver
Collecting cassandra-driver
  Using cached cassandra-driver-3.9.0.tar.gz
Requirement already satisfied: six>=1.6 in c:\python27\lib\site-packages (from c
assandra-driver)
Requirement already satisfied: futures in c:\python27\lib\site-packages (from ca
ssandra-driver)
Building wheels for collected packages: cassandra-driver
  Running setup.py bdist_wheel for cassandra-driver ... error
  Complete output from command c:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\user01\\appdata\\local\\temp\\pip-build-pa7rph\\
cassandra-driver\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.r
ead().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdi
st_wheel -d c:\users\user01\appdata\local\temp\tmpbqprncpip-wheel- --python-ta
g cp27:
  Unable to find pgen, not compiling formal grammar.
  warning: no files found matching '*.pyx' under directory 'Cython\Debugger\Test
s'
  warning: no files found matching '*.pxd' under directory 'Cython\Debugger\Test
s'
  warning: no files found matching '*.h' under directory 'Cython\Debugger\Tests'

  warning: no files found matching '*.pxd' under directory 'Cython\Utility'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "c:\users\user01\appdata\local\temp\pip-build-pa7rph\cassandra-driver
\setup.py", line 433, in <module>
      run_setup(None)
    File "c:\users\user01\appdata\local\temp\pip-build-pa7rph\cassandra-driver
\setup.py", line 431, in run_setup
      **kw)
    File "c:\python27\lib\distutils\core.py", line 112, in setup
      _setup_distribution = dist = klass(attrs)
    File "c:\python27\lib\site-packages\setuptools\dist.py", line 318, in __init
__
      self.fetch_build_eggs(attrs['setup_requires'])
    File "c:\python27\lib\site-packages\setuptools\dist.py", line 373, in fetch_
build_eggs
      replace_conflicting=True,
    File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 851, in
 resolve
      dist = best[req.key] = env.best_match(req, ws, installer)
    File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1123, i
n best_match
      return self.obtain(req, installer)
    File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1135, i
n obtain
      return installer(requirement)
    File "c:\python27\lib\site-packages\setuptools\dist.py", line 441, in fetch_
build_egg
      return cmd.easy_install(req)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 674, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 700, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 881, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 1120, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 1108, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: INCLUDE envir
onment variable is empty

  ----------------------------------------
  Failed building wheel for cassandra-driver
  Running setup.py clean for cassandra-driver
  Complete output from command c:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\user01\\appdata\\local\\temp\\pip-build-pa7rph\\
cassandra-driver\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.r
ead().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" cle
an --all:
  Unable to find pgen, not compiling formal grammar.
  warning: no files found matching '*.pyx' under directory 'Cython\Debugger\Test
s'
  warning: no files found matching '*.pxd' under directory 'Cython\Debugger\Test
s'
  warning: no files found matching '*.h' under directory 'Cython\Debugger\Tests'

  warning: no files found matching '*.pxd' under directory 'Cython\Utility'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "c:\users\user01\appdata\local\temp\pip-build-pa7rph\cassandra-driver
\setup.py", line 433, in <module>
      run_setup(None)
    File "c:\users\user01\appdata\local\temp\pip-build-pa7rph\cassandra-driver
\setup.py", line 431, in run_setup
      **kw)
    File "c:\python27\lib\distutils\core.py", line 112, in setup
      _setup_distribution = dist = klass(attrs)
    File "c:\python27\lib\site-packages\setuptools\dist.py", line 318, in __init
__
      self.fetch_build_eggs(attrs['setup_requires'])
    File "c:\python27\lib\site-packages\setuptools\dist.py", line 373, in fetch_
build_eggs
      replace_conflicting=True,
    File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 851, in
 resolve
      dist = best[req.key] = env.best_match(req, ws, installer)
    File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1123, i
n best_match
      return self.obtain(req, installer)
    File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1135, i
n obtain
      return installer(requirement)
    File "c:\python27\lib\site-packages\setuptools\dist.py", line 441, in fetch_
build_egg
      return cmd.easy_install(req)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 674, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 700, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 881, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 1120, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", lin
e 1108, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: INCLUDE envir
onment variable is empty

  ----------------------------------------
  Failed cleaning build dir for cassandra-driver
Failed to build cassandra-driver
Installing collected packages: cassandra-driver
  Running setup.py install for cassandra-driver ... error
    Complete output from command c:\python27\python.exe -u -c "import setuptools
, tokenize;__file__='c:\\users\\user01\\appdata\\local\\temp\\pip-build-pa7rph
\\cassandra-driver\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f
.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" i
nstall --record c:\users\user01\appdata\local\temp\pip-inudnv-record\install-r
ecord.txt --single-version-externally-managed --compile:
    Unable to find pgen, not compiling formal grammar.
    warning: no files found matching '*.pyx' under directory 'Cython\Debugger\Te
sts'
    warning: no files found matching '*.pxd' under directory 'Cython\Debugger\Te
sts'
    warning: no files found matching '*.h' under directory 'Cython\Debugger\Test
s'
    warning: no files found matching '*.pxd' under directory 'Cython\Utility'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\user01\appdata\local\temp\pip-build-pa7rph\cassandra-driv
er\setup.py", line 433, in <module>
        run_setup(None)
      File "c:\users\user01\appdata\local\temp\pip-build-pa7rph\cassandra-driv
er\setup.py", line 431, in run_setup
        **kw)
      File "c:\python27\lib\distutils\core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "c:\python27\lib\site-packages\setuptools\dist.py", line 318, in __in
it__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "c:\python27\lib\site-packages\setuptools\dist.py", line 373, in fetc
h_build_eggs
        replace_conflicting=True,
      File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 851,
in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1123,
 in best_match
        return self.obtain(req, installer)
      File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 1135,
 in obtain
        return installer(requirement)
      File "c:\python27\lib\site-packages\setuptools\dist.py", line 441, in fetc
h_build_egg
        return cmd.easy_install(req)
      File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 674, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 700, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 881, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 1120, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 1108, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: INCLUDE env
ironment variable is empty

    ----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\
\users\\user01\\appdata\\local\\temp\\pip-build-pa7rph\\cassandra-driver\\setu
p.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users
\user01\appdata\local\temp\pip-inudnv-record\install-record.txt --single-versi
on-externally-managed --compile" failed with error code 1 in c:\users\user01\a
ppdata\local\temp\pip-build-pa7rph\cassandra-driver\

Jaume

unread,
May 15, 2017, 4:51:29 PM5/15/17
to DataStax Python Driver for Apache Cassandra User Mailing List
Hi Shiva,

It's hard to know from this information. I get a similar error when cython is not installed so it could be related. You could try installing the driver without cython enabled: pip install cassandra-driver --install-option="--no-cython".
If this doesn't solve you issue:
- Do you get the same error with the above command?
- Is cython installed?
- What windows version and architecture are you trying to install the driver on?

Thanks,
Jaume
Message has been deleted

Shiva Dasari

unread,
May 17, 2017, 12:25:20 AM5/17/17
to DataStax Python Driver for Apache Cassandra User Mailing List
Thank you Jaume.

I'm able to install cassandra-driver successfully with command you have provided. If possible can you brief me what this command does when "--install-option" set to "--no-cython". 

pip install cassandra-driver --install-option="--no-cython"


Jaume

unread,
May 17, 2017, 8:05:51 AM5/17/17
to DataStax Python Driver for Apache Cassandra User Mailing List
Hi Shiva,

No problem. It disables the cython extensions for the python driver so it'll be installed without them. I'd say it's likely cython is not installed in your system so the default setup fails. This link can be useful: http://datastax.github.io/python-driver/installation.html#windows-build

Jaume
Reply all
Reply to author
Forward
0 new messages