Why can't I install Cassandra-driver - python

I am studying Cassandra by its document.
But when I use "pip install cassandra-driver" to install cassandra-driver ,failed like this:
weikairen2#weikairen2-virtual-machine:~$ pip install cassandra-driver
Collecting cassandra-driver
Using cached cassandra-driver-3.7.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): six>=1.6 in ./.local/lib/python2.7/site-packages (from cassandra-driver)
Requirement already satisfied (use --upgrade to upgrade): futures in ./.local/lib/python2.7/site-packages (from cassandra-driver)
Building wheels for collected packages: cassandra-driver
Running setup.py bdist_wheel for cassandra-driver ...
^Z
[1]+ 已停止 pip install cassandra-driver
weikairen2#weikairen2-virtual-machine:~$ ls
cassandra jdk 公共的 图片 音乐
cassandra-driver-3.7.0 pycharm 模板 文档 桌面
examples.desktop PycharmProjects 视频 下载
weikairen2#weikairen2-virtual-machine:~$ cd cassandra-driver-3.7.0
weikairen2#weikairen2-virtual-machine:~/cassandra-driver-3.7.0$ ls
cassandra ez_setup.py MANIFEST.in README.rst setup.py
cassandra_driver.egg-info LICENSE PKG-INFO setup.cfg
weikairen2#weikairen2-virtual-machine:~/cassandra-driver-3.7.0$ python setup.py install
^Z
[2]+ 已停止 python setup.py install
weikairen2#weikairen2-virtual-machine:~/cassandra-driver-3.7.0$ python setup.py build
as you can see,there is no response
and I have to stop it by ctrl+z
I also tried manul install
no response again
So where is the error? How can I fix it?

I figure out
"sudo pip install cassandra-driver"
it takes a little long time
I was just too impatient

It takes a long time, ~10mins in some environments. You can use
$ # installing from source
$ CASS_DRIVER_BUILD_CONCURRENCY=8 python setup.py install
$ # installing from pip
$ CASS_DRIVER_BUILD_CONCURRENCY=8 pip install cassandra-driver
to speed it up.
Source: https://docs.datastax.com/en/developer/python-driver/3.25/installation/

Related

Docker pip3 not installing packages

I have the following Dockerfile and requirements.txt file. The requirements.txt appears to be processed, but I don't see any output "Installing collected packages" statements like I see when I install the packages on my system without Docker. In the docker build I end up with an error where the previous package in requirements.txt should have been installed.
Dockerfile
FROM alpine:3.8
ADD . /code
RUN apk add alpine-sdk python3-dev
WORKDIR /code
RUN sudo apk update
RUN pip3 install --trusted-host pypi.python.org -r requirements.txt
CMD ["python3", "linqcmd"]
requirements.txt
boto3
click
python-levenshtein
python-dateutil
cython
# pip3 install git+https://github.com/izderadicka/pdfparser
-e git://github.com/izderadicka/pdfparser.git#egg=pdfparser
docker-compose up --build output
...
Step 6/7 : RUN pip3 install --trusted-host pypi.python.org -r requirements.txt
---> Running in 515dd716aa7c
Collecting boto3 (from -r requirements.txt (line 4))
Downloading https://files.pythonhosted.org/packages/a8/45/810f786ce144bfd19d9f2f700a8cd4358435559a2b88b2c235f7bb3f29df/boto3-1.8.6-py2.py3-none-any.whl (128kB)
Collecting click (from -r requirements.txt (line 5))
Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
Collecting python-levenshtein (from -r requirements.txt (line 6))
Downloading https://files.pythonhosted.org/packages/42/a9/d1785c85ebf9b7dfacd08938dd028209c34a0ea3b1bcdb895208bd40a67d/python-Levenshtein-0.12.0.tar.gz (48kB)
Collecting python-dateutil (from -r requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)
Collecting cython (from -r requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/21/89/ca320e5b45d381ae0df74c4b5694f1471c1b2453c5eb4bac3449f5970481/Cython-0.28.5.tar.gz (1.9MB)
Obtaining pdfparser from git+git://github.com/izderadicka/pdfparser.git#egg=pdfparser (from -r requirements.txt (line 10))
Cloning git://github.com/izderadicka/pdfparser.git to ./src/pdfparser
Complete output from command python setup.py egg_info:
You need to install cython first - sudo pip install cython
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /code/src/pdfparser/
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
ERROR: Service 'web' failed to build: The command '/bin/sh -c pip3 install --trusted-host pypi.python.org -r requirements.txt' returned a non-zero code: 1
By design, pip doesn't install any packages until after it's collected & built wheels for everything it's going to install; this is done to prevent a failure in the middle of installation from causing only some packages to be installed. Thus, in your case, cython won't be installed before a wheel is built for pdfparser, which apparently needs cython in order to build, and so the installation fails. You need to install cython and pdfparser in two separate steps.

Flatlib - bdist_wheel error

I am trying to install python flatlib, but i am getting an error:
Running setup.py bdist_wheel for pyswisseph ... error.
Failed building wheel for pyswisseph
Collecting pyswissep
Could not find a version that satisfies the requirement pyswissep (from versions: )
No matching distribution found for pyswissep
I have installed the latest Visual Studio C++ Build Tools.
I have run:
pip install -U setuptools
pip install - wheel
pip install update
easy_install -U pip
python -m pip install --upgrade pip
I'm using Python 3.7 and Pip 18.0
The usual ideas i can find don't have any effect!
Can anyone help?
Cheers, Will

pip install .[test] not working in python2.7.9 pip version 6.0.7

To the best of my knowledge pip install .[extras_require here] has always worked. I can't find in any documentation when that feature was added, but I've never had any problem even on very old machines.
Is pip definitely the problem here. I could add 'pip install --upgrade pip', but I don't have merge rights to the repo that is currently having the problem.
From setup.py
extras_require={
'test': ['flake8', 'pytest>=2.9.0'],
},
In python 2.7.9
$ python --version
Python 2.7.9
$ pip --version
pip 6.0.7 from /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages (python 2.7)
$ pip install .[test]
Collecting .[test]
Could not find any downloads that satisfy the requirement .[test]
No distributions at all found for .[test]
The command "pip install .[test]" failed and exited with 1 during .
From 3.5.2:
$ python --version
Python 3.5.2
$ pip --version
pip 9.0.1 from /home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages (python 3.5)
$ pip install .[test]
Processing /home/travis/build/Brian-Williams/repo_python
Collecting flake8 (from refactor-me==0.1.0)
Downloading flake8-3.3.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 71kB 6.1MB/s
Requirement already satisfied: pytest>=2.9.0 in /home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages (from refactor-me==0.1.0)
Collecting pycodestyle<2.4.0,>=2.0.0 (from flake8->refactor-me==0.1.0)
Downloading pycodestyle-2.3.1-py2.py3-none-any.whl (45kB)
100% |███████████████���████████████████| 51kB 10.6MB/s
Collecting mccabe<0.7.0,>=0.6.0 (from flake8->refactor-me==0.1.0)
Downloading mccabe-0.6.1-py2.py3-none-any.whl
Collecting pyflakes<1.6.0,>=1.5.0 (from flake8->refactor-me==0.1.0)
Downloading pyflakes-1.5.0-py2.py3-none-any.whl (225kB)
100% |████████████████████████████████| 225kB 7.1MB/s
Requirement already satisfied: py>=1.4.29 in /home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages (from pytest>=2.9.0->refactor-me==0.1.0)
Installing collected packages: pycodestyle, mccabe, pyflakes, flake8, refactor-me
Running setup.py install for refactor-me ... - done
Successfully installed flake8-3.3.0 mccabe-0.6.1 pycodestyle-2.3.1 pyflakes-1.5.0 refactor-me-0.1.0
For your version of pip you need to run
pip install -e .[test]
to be able to install extras from a directory
I got merge access. Adding upgrade pip to the install stage of .travis.yml fixed it:
install:
# update pip to ensure extras_require format is supported
- 'pip install --upgrade pip'
- 'pip install ".[test]"'
From the successful run replacing 6.0.7 with pip-9.0.1 was the delta.

Python - Where is the pip executable after install?

Since I am on a server and do not have admin privilege, I need to install my own version of python and pip locally. After installed python, I used the code python get-pip.py --user which is on the official site. I get the following return and seems pip is successfully installed. But I do not know where is the pip executable so that I cannot add it to the system environment. So where is it installed?
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Collecting setuptools
Using cached setuptools-27.2.0-py2.py3-none-any.whl
Collecting wheel
Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip setuptools wheel
On Unix, pip install --user ... drops scripts into ~/.local/bin
pip sould be somewhere around ~/.local

Python equivalent of node.js's npm link to use local development versions of requirements?

In Node.js, I'm used to using npm link to get a project to use a custom version of a dependency. From the Node documentation:
First, npm link in a package folder will create a globally-installed symbolic link from prefix/package-name to the current folder.
Next, in some other location, npm link package-name will create a symlink from the local node_modules folder to the global symlink.
Is it kosher to do something similar by symlinking into site-packages?
The exact analogue is pip install -e . or python setup.py develop.
https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs
Perhaps, but what you probably want to do is use virtualenv. Virtualenv allows you to create a python environment isolated from any others:
$ virtualenv myenv
New python executable in myenv/bin/python
Installing setuptools............done.
Installing pip...............done.
$ source myenv/bin/activate
You can then install specific versions of python packages as you please, say version 0.1.0 of a random toolz package I just found, when the lastest version is 0.2.1:
(myenv)$ pip install toolz==0.1.0
Downloading/unpacking toolz==0.1.0
Downloading toolz-0.1.tar.gz
Running setup.py egg_info for package toolz
Downloading/unpacking itertoolz>=0.5 (from toolz==0.1.0)
Downloading itertoolz-0.5.tar.gz
Running setup.py egg_info for package itertoolz
Downloading/unpacking functoolz>=0.4 (from toolz==0.1.0)
Downloading functoolz-0.4.tar.gz
Running setup.py egg_info for package functoolz
Installing collected packages: toolz, itertoolz, functoolz
Running setup.py install for toolz
Running setup.py install for itertoolz
Running setup.py install for functoolz
Successfully installed toolz itertoolz functoolz
Cleaning up...
As you can see it also installs dependencies. You can also generate a requirements file:
(myenv)$ pip freeze
functoolz==0.4
itertoolz==0.5
toolz==0.1
wsgiref==0.1.2
Which you can then use to duplicate those same dependencies in another virtualenv
(myenv)$ pip freeze > reqs.txt
(myenv)$ deactivate
$ source env2/bin/activate
(env2)$ pip freeze
wsgiref==0.1.2
(env2)$ pip install -r reqs.txt
Downloading/unpacking functoolz==0.4 (from -r reqs.txt (line 1))
Downloading functoolz-0.4.tar.gz
Running setup.py egg_info for package functoolz
Downloading/unpacking itertoolz==0.5 (from -r reqs.txt (line 2))
Downloading itertoolz-0.5.tar.gz
Running setup.py egg_info for package itertoolz
Downloading/unpacking toolz==0.1 (from -r reqs.txt (line 3))
Downloading toolz-0.1.tar.gz
Running setup.py egg_info for package toolz
Requirement already satisfied (use --upgrade to upgrade): wsgiref==0.1.2 in /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 (from -r reqs.txt (line 4))
Installing collected packages: functoolz, itertoolz, toolz
Running setup.py install for functoolz
Running setup.py install for itertoolz
Running setup.py install for toolz
Successfully installed functoolz itertoolz toolz
Cleaning up...

Categories