error while trying to install cassandra-driver using python - python

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
Install 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\

i'm able to install cassandra-driver successfully using following command,
command:
pip install cassandra-driver --install-option="--no-cython"
Following is the complete installation log(fyi):
C:\Windows\System32>pip install cassandra-driver --install-option="--no-cython"
c:\python27\lib\site-packages\pip\commands\install.py:194: UserWarning: Disablin
g all use of wheels due to the use of --build-options / --global-options / --ins
tall-options.
cmdoptions.check_install_build_global(options)
Collecting cassandra-driver
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py
:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Na
me Indication) extension to TLS is not available on this platform. This may caus
e the server to present an incorrect TLS certificate, which can cause validation
failures. You can upgrade to a newer version of Python to solve this. For more
information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissi
ngwarning.
SNIMissingWarning
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py
:122: InsecurePlatformWarning: A true SSLContext object is not available. This p
revents urllib3 from configuring SSL appropriately and may cause certain SSL con
nections to fail. You can upgrade to a newer version of Python to solve this. Fo
r more information, see https://urllib3.readthedocs.io/en/latest/security.html#i
nsecureplatformwarning.
InsecurePlatformWarning
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)
Skipping bdist_wheel for cassandra-driver, due to binaries being disabled for it
.
Installing collected packages: cassandra-driver
Running setup.py install for cassandra-driver ... done
Successfully installed cassandra-driver-3.9.0

I installed cqlsh client on remote using following command,
sudo apt-get install build-essential python-dev python-pip libev4 libev-dev
sudo apt-get install cython3
sudo pip install cassandra-driver
sudo pip install cassandra-driver --install-option="--no-cython"
sudo pip install cqlsh; (Or cqlsh==5.0.3)
export CQLSH_NO_BUNDLED=TRUE
cqlsh 192.168.0.330 --cqlversion="3.4.2"

cassandra-driver apparently needs cython. So pip install cython would fix this.

None of the above worked for me as I was using virtualenv. i.e.
yum install -y python-virtualenv
virtualenv-2.7 /opt/test
What worked for me was as follows:
/opt/test/bin/pip install --upgrade pip
/opt/test/bin/pip install typing cython
/opt/test/bin/pip install cassandra-driver

Related

Python PIP issue when installing Ray - The wheel package is not available

I'm trying to install Ray - this can be done with a simple pip install ray
During the installation, packages get downloaded and installed correctly until it reaches gpustat
Python version: 3.8.7
OS: Linux (cflinuxfs3 to be more specific)
Here's the stacktrace
Downloading https://masked-package-path/packages/packages/b4/69/gpustat-0.6.0.tar.gz (78 kB)
ERROR: Command errored out with exit status 1:
command: /tmp/contents295671398/deps/0/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tdlwfmx8/gpustat/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tdlwfmx8/gpustat/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-4yij8vu9
cwd: /tmp/pip-install-tdlwfmx8/gpustat/
Complete output (22 lines):
WARNING: The wheel package is not available.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-tdlwfmx8/gpustat/setup.py", line 91, in <module>
setup(
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
_install_setup_requires(attrs)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
dist = best[req.key] = env.best_match(
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
return self.obtain(req, installer)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
return installer(requirement)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
return fetch_build_egg(self, req)
File "/tmp/contents295671398/deps/0/python/lib/python3.8/site-packages/setuptools/installer.py", line 83, in fetch_build_egg
raise DistutilsError('the `allow-hosts` option is not supported '
distutils.errors.DistutilsError: the `allow-hosts` option is not supported when using pip to install requirements.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
**ERROR** Could not install pip packages: could not run pip: exit status 1
Also, I tried installing wheel (because the WARNING is saying it's missing) but no luck.
Any known issues regarding gpustat-0.6.0?
I had a similar error, but it was caused by gpustat's requirement for pytest-runner.
Running pip install pytest-runner fixed it for me. Just sharing in case anyone else has this problem.
Note: this was being done through a corporate proxy.

Unable to install the new tflite-support using pip

Following this link, I've been trying to install the tflite-support module using pip. I get the following error:
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/setup.py'"'"'; __file__='"'"'/private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/pip-egg-info
cwd: /private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/
Complete output (27 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/setup.py", line 178, in <module>
zip_safe=False,
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/__init__.py", line 143, in setup
_install_setup_requires(attrs)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/__init__.py", line 138, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/dist.py", line 698, in fetch_build_eggs
replace_conflicting=True,
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/pkg_resources/__init__.py", line 783, in resolve
replace_conflicting=replace_conflicting
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/pkg_resources/__init__.py", line 1066, in best_match
return self.obtain(req, installer)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/pkg_resources/__init__.py", line 1078, in obtain
return installer(requirement)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/dist.py", line 754, in fetch_build_egg
return fetch_build_egg(self, req)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
wheel.install_as_egg(dist_location)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/wheel.py", line 103, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/wheel.py", line 111, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/wheel.py", line 132, in _convert_metadata
os.mkdir(destination_eggdir)
FileExistsError: [Errno 17] File exists: '/private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/.eggs/pybind11-2.4.3-py3.7.egg'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Any leads? I know similar questions have been asked before, but no luck with those answers
Turning the comment into an answer:
This looks like a regression in setuptools. Downgrade to 41:
$ pip install --upgrade 'setuptools<42'
Now (ideally) preinstall pybind11 to avoid missing headers when building the tflite-support wheel:
$ pip install 'pybind11>=2.4'
Now installing tflite-support should succeed without any intermediate errors:
$ pip install tflite-support

Can't install cryptography on raspberry pi because of libffi [duplicate]

This question already has answers here:
pip install failing with: OSError: [Errno 13] Permission denied on directory
(9 answers)
Closed 4 years ago.
I've been trying to install the package "flask-ask" on my Raspberry Pi Zero. However, there's a problem when trying to install the dependency "cryptography":
Downloading/unpacking cryptography
Downloading cryptography-2.2.2.tar.gz (443kB): 443kB downloaded
Running setup.py (path:/tmp/pip-build-wg353po4/cryptography/setup.py) egg_info for package cryptography
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-wg353po4/cryptography/setup.py", line 28, in <module>
"cryptography requires setuptools 18.5 or newer, please upgrade to a "
RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-wg353po4/cryptography/setup.py", line 28, in <module>
"cryptography requires setuptools 18.5 or newer, please upgrade to a "
RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-wg353po4/cryptography
Storing debug log for failure in /home/pi/.pip/pip.log
(these logs gotten from trying to install cryptography on its own, but the same error is gotten when installing flask-ask)
I've tried pip3 install -U setuptools to upgrade it, but that doesn't work:
pi#raspberrypi:~ $ pip3 install -U setuptools
Downloading/unpacking setuptools from https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl#sha256=8fca9275c89964f13da985c3656cb00ba029d7f3916b37990927ffdf264e7926
Downloading setuptools-39.2.0-py2.py3-none-any.whl (567kB): 567kB downloaded
Installing collected packages: setuptools
Found existing installation: setuptools 5.5.1
Not uninstalling setuptools at /usr/lib/python3/dist-packages, owned by OS
Can't roll back setuptools; was not uninstalled
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 295, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
pycompile=self.pycompile,
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 214, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 208, in clobber
shutil.copy2(srcfile, destfile)
File "/usr/lib/python3.4/shutil.py", line 244, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.4/shutil.py", line 108, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/easy_install.py'
Storing debug log for failure in /home/pi/.pip/pip.log
So what should I do? I've done a lot of googling of various different things, and I've seen other people have problems with cryptography on the Pi, but not this specific problem.
EDIT: Ok, so I've done pip install --user -U setuptools now, and that works fine. Now I'm getting a totally different error:
running install_egg_info
running egg_info
creating lib/PyYAML.egg-info
writing lib/PyYAML.egg-info/PKG-INFO
writing top-level names to lib/PyYAML.egg-info/top_level.txt
writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
writing manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
reading manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
writing manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
Copying lib/PyYAML.egg-info to /home/pi/.local/lib/python2.7/site-packages/PyYAML-3.12$
running install_scripts
writing list of installed files to '/tmp/pip-XYXo6X-record/install-record.txt'
Could not find .egg-info directory in install record for PyYAML==3.12 (from flask-ask)
Running setup.py install for cryptography
Running command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-bui$
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-2gl72v/cryptography/setup.py", line 319, in <module>
**keywords_with_side_effects(sys.argv)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 128,$
_install_setup_requires(attrs)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 123,$
dist.fetch_build_eggs(dist.setup_requires)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 514, in $
replace_conflicting=True,
File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 7$
replace_conflicting=replace_conflicting
File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1$
return self.obtain(req, installer)
File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1$
return installer(requirement)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 581, in $
return cmd.easy_install(req)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
dists = self.install_eggs(spec, download, tmpdir)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
return self.build_and_install(setup_script, setup_base)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
self.run_setup(setup_script, setup_base, args)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gn$
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__=$
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-2gl72v/cryptography/setup.py", line 319, in <module>
**keywords_with_side_effects(sys.argv)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 128, in $
_install_setup_requires(attrs)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 123, in $
dist.fetch_build_eggs(dist.setup_requires)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 514, in fetc$
replace_conflicting=True,
File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 770, $
replace_conflicting=replace_conflicting
File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1053,$
return self.obtain(req, installer)
File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065,$
return installer(requirement)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 581, in fetc$
return cmd.easy_install(req)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$
dists = self.install_eggs(spec, download, tmpdir)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$
return self.build_and_install(setup_script, setup_base)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$
self.run_setup(setup_script, setup_base, args)
File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueab$
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-2gl72v/cr$
Exception information:
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 295, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 707, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 716, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/$
I have no clue why this is happening at this point.
I've had luck in a similar situation recently by first updating pip.
sudo apt-get install -y python3-pip
sudo pip3 -H pip3 install --upgrade pip

Install of graphite in centos-7 using pip

I'm following below link when i try to run this (pip install graphite-web) its failing.
https://www.vultr.com/docs/how-to-install-and-configure-graphite-on-centos-7
Collecting graphite-web
Using cached graphite-web-1.0.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): Django<1.9.99,>=1.8 in /usr/lib64/python2.7/site-packages (from graphite-web)
Collecting django-tagging==0.4.3 (from graphite-web)
Using cached django_tagging-0.4.3-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pytz in /usr/lib/python2.7/site-packages (from graphite-web)
Collecting pyparsing (from graphite-web)
Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Collecting cairocffi (from graphite-web)
Using cached cairocffi-0.8.0.tar.gz
Complete output from command python setup.py egg_info:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-EgudUq/cairocffi/setup.py", line 44, in <module>
extras_require={'xcb': ['xcffib>=0.3.2']},
File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match
return self.obtain(req, installer) # try and download/install
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain
return installer(requirement)
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 653, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 849, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1130, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1118, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-EgudUq/cairocffi/
fixed by running
pip install cairocffi==0.6

python setup.py egg_info gcc error installing cassandra python

For some reason, the specific version that I need to install manually cannot be accessed directly:
rpm -i ftp://195.220.108.108/linux/centos/7.1.1503/updates/x86_64/Packages/python-2.7.5-18.el7_1.1.x86_64.rpm
So tried a brand new installation of python, then tried updating and installing setup tools
yum -y update
yum -y install python-pip
pip install -U pip
pip install -U setuptools
pip install cassandra-driver
yum install patch
then tried
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
python ez_setup.py
pip install cassandra-driver
Full stacktrace
[root#d8174406546b cassandradump]# pip install cassandra-driver
Collecting cassandra-driver
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject
Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validat
ion failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. Thi
s prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/e
n/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached cassandra-driver-3.0.0.tar.gz
Complete output from command python setup.py egg_info:
warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Utility'
unable to execute gcc: No such file or directory
Unable to find pgen, not compiling formal grammar.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-cP9FYQ/cassandra-driver/setup.py", line 375, in <module>
run_setup(None)
File "/tmp/pip-build-cP9FYQ/cassandra-driver/setup.py", line 373, in run_setup
**kw)
File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 827, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1072, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1084, in obtain
return installer(requirement)
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 640, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 670, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 853, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1081, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1069, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cP9FYQ/cassandra-driver
Typed enter too early, missed gcc library and got carried away by similar posts.
/tmp/easy_install-N19BCp/Cython-0.23.4/Cython/Plex/Scanners.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
Unable to find pgen, not compiling formal grammar.
Traceback (most recent call last):
Then python-devel solved the problem.
install yum install python-devel
I am working inside docker so prefixed the 'RUN'. On real systems, you will need to use sudo in place of RUN. Sometimes, the pip is tool old. In my case it was 7.x so I also upgraded it. cython depends on python-devel
RUN pip install --upgrade pip
RUN yum -y install python-devel
RUN pip install cython

Categories

Resources