I am using Pycharm on windows 7 32bit, i am learning to make a website using django. i am trying to make imagefield, so i tried to install Pillow in the command window and it give me this error:
(venv) C:\Users\مرحبا\PycharmProjects\TryDjango>py -m pip install Pillow
Collecting Pillow
Exception:
Traceback (most recent call last):
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\basecommand.py", line 228, in main
status = self.run(options, args)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\commands\install.py", line 291, in run
resolver.resolve(requirement_set)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\resolve.py", line 103, in resolve
self._resolve_one(requirement_set, req)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\resolve.py", line 257, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\resolve.py", line 210, in _get_abstract_dist_for
self.require_hashes
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\operations\prepare.py", line 245, in
prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\req\req_install.py", line 307, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\index.py", line 484, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\index.py", line 442, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\index.py", line 587, in _get_pages
page = self._get_page(location)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\index.py", line 705, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\index.py", line 814, in get_page
"Cache-Control": "max-age=600",
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\requests\sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\download.py", line 397, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\requests\sessions.py", line 658, in send
r.content
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\requests\models.py", line 823, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\requests\models.py", line 745, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\urllib3\response.py", line 436, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\urllib3\response.py", line 384, in read
data = self._fp.read(amt)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\cachecontrol\filewrapper.py", line 63, in read
self._close()
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\cachecontrol\filewrapper.py", line 50, in _close
self.__callback(self.__buf.getvalue())
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\cachecontrol\controller.py", line 296, in cache_response
self.serializer.dumps(request, response, body=body),
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_internal\download.py", line 298, in set
return super(SafeFileCache, self).set(*args, **kwargs)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\cachecontrol\caches\file_cache.py", line 113, in set
with self.lock_class(name) as lock:
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\lockfile\mkdirlockfile.py", line 19, in __init__
LockBase.__init__(self, path, threaded, timeout)
File "C:\Users\مرحبا\AppData\Local\Programs\lib\site-
packages\pip\_vendor\lockfile\__init__.py", line 226, in __init__
self.tname = '-%x' % (ident & 0xffffffff)
TypeError: unsupported operand type(s) for &: 'method' and 'int'
actually i am beginner, please tell me what to do, i am at the last step to finish my first website, and i need to install the pillow in order to make imagefield in my model.
could you help me Please?
First try the following-
pip install Pillow
If the above doesn't work, try the following-
pip3 install Pillow
Edit 1:
If pip is showing error, do the following-
1) Check which version of python you are using. The latest version is 3.8. See if the following shows any error?
python3
If the above command shows error, that means you may need to install the latest version of python from its website.
2) Check the pip version-
pip -V
# pip 20.0.2 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
python3 -m pip install --upgrade pip
The above should install the lates pip version (20.0.2). Then try to install Pillow with pip.
Related
I have a problem to ask regarding paho-mqtt. Whenever i tried to install
sudo pip install paho-mqtt
It would come out something like this
Collecting paho-mqtt
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 350, in _make_request
self._validate_conn(conn)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 837, in _validate_conn
conn.connect()
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 323, in connect
ssl_context=context)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/ssl_.py", line 308, in ssl_wrap_socket
context.load_verify_locations(ca_certs, ca_cert_dir)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 392, in load_verify_locations
self._ctx.load_verify_locations(cafile, capath)
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 525, in load_verify_locations
_raise_current_error()
File "/usr/lib/python2.7/dist-packages/OpenSSL/_util.py", line 48, in exception_from_error_queue
raise exception_type(errors)
Error: []
I tried this method
cd /usr/lib/python2.7/dist-packages
sudo ln -s /home/pi/.local/lib/python2.7/site-packages/paho
But it still shows the same problem. This problem have been occuring for a long time and i did alot of research using various solution but the problem still remain the same. Apparently, anything regarding to pip installation i would face the traceback problem. I really need some help regarding this. Thank you!
I manage to solve the problem which is there is something went wrong with my OS installation, i was using NOOBS previously and now i tried to install the OS of "Raspbian Stretch with desktop" and now it is working perfectly fine.
I got this same error in previous days.
You should try this before installing paho-mqtt.
pip install --upgrade setuptools
please let me know if its work or not!
for more information, Go to Onion Docs
I'm working on a legacy app that needs python2.6.2.
I installed successfully python 2.6.2 and setuptools.
Now when I try to create a virtualenv using this version it gives me this error:
$ virtualenv --python=/usr/local/python2.6.2/bin/python mypythonnewapp
Running virtualenv with interpreter /usr/local/python2.6.2/bin/python
New python executable in /home/vagrant/mypythonnewapp/bin/python
Installing setuptools<37, pip, wheel<0.30...
Complete output from command /home/vagrant/mypythonnewapp/bin/python - setuptools<37 pip wheel<0.30:
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting setuptools<37
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/adapter.py", line 37, in send
cached_response = self.controller.cached_request(request)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/controller.py", line 111, in cached_request
resp = self.serializer.loads(request, cache_data)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/serialize.py", line 114, in loads
return getattr(self, "_loads_v{0}".format(ver))(request, data)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/serialize.py", line 196, in _loads_v2
return self.prepare_response(request, cached)
File "/usr/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/serialize.py", line 157, in prepare_response
**cached["response"]
TypeError: __init__() keywords must be strings
----------------------------------------
...Installing setuptools<37, pip, wheel<0.30...done.
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 2349, in <module>
main()
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 712, in main
symlink=options.symlink)
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 953, in create_environment
download=download,
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 904, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 796, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/vagrant/mypythonnewapp/bin/python - setuptools<37 pip wheel<0.30 failed with error code 2
Any suggestions other than upgrading anything are welcome.
Thanks
This seems like a bug in virtualenv. See how virtualenv.py limits versions of setuptools and wheel for Python 2.6, but not for pip. It must limit pip to version '<10' for Py 2.6. Please report the bug or better send a pull request.
Meanwhile create a virtualenv with --no-pip and later install pip into the virtualenv manually.
Try using pyenv. At least it claims to support versions of Python back to 2.1.3
I'm trying to install matplotlib for python 3.6.3 using, but I keep getting this exception all the time. I have tried using the whl files too, to do it manually, but same result. I'm using this link to get the whl:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools
Also tried Anaconda, and python 2.7,3.4 and 3.5, and still can't fix the issue.
Exception:
Traceback (most recent call last):
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 554, in _prepare_file
require_hashes
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\cachecontrol\adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\adapters.py", line 423, in send
timeout=timeout
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 589, in urlopen
self._prepare_proxy(conn)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 797, in _prepare_proxy
conn.connect()
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connection.py", line 254, in connect
conn = self._new_conn()
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connection.py", line 142, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\connection.py", line 66, in create_connection
if host.startswith('['):
AttributeError: 'NoneType' object has no attribute 'startswith'
Try upgrading pip
pip install --upgrade pip
You might have to use the full path to pip, if it's not in the PATH variable, like so:
C:\Users\Marcin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip install --upgrade pip
Edit:
After searching and finding some duplicates on the web (with no solutions), it seems to me it might have something to do with the path of your python installation.
Such as: duplicate 1, and duplicate 2.
Is there a reason its not installed on the default C:\Python36-32 folder?
You might want to download and install the windows msi installer for python in the recommended way, and see where that gets you.
Solution:
After OP's comment, it seems that moving Python to C:\ path (preferably with a clean install with windows .msi from python.org should fix this issue.
I have a special need that i need install resource pkg at a pc without network.
So i choose to use pip download first, and copy all downloaded files to this pc then pip install.
$ pip download resource
$ ls
JsonForm-0.0.2-py2-none-any.whl PyYAML-3.12.tar.gz Resource-0.2.0-py2.py3-none-any.whl jsonschema-2.6.0-py2.py3-none-any.whl six-1.9.0-py2.py3-none-any.whl
JsonSir-0.0.2-py2-none-any.whl Python_EasyConfig-0.1.6-py2.py3-none-any.whl functools32-3.2.3-2.zip
copy all files to the special pc to do:
$ pip install Resource-0.2.0-py2.py3-none-any.whl
Processing ./Resource-0.2.0-py2.py3-none-any.whl
Collecting python-easyconfig>=0.1.0 (from Resource==0.2.0)
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
It seems dependences not installed. I have a rough way to fix it:
$ pip install six-1.9.0-py2.py3-none-any.whl
$ pip install PyYAML-3.12.tar.gz
$ pip install Python_EasyConfig-0.1.6-py2.py3-none-any.whl
$ pip install JsonSir-0.0.2-py2-none-any.whl
$ pip install functools32-3.2.3-2.zip
$ pip install jsonschema-2.6.0-py2.py3-none-any.whl
$ pip install JsonForm-0.0.2-py2-none-any.whl
$ pip install Resource-0.2.0-py2.py3-none-any.whl
But it is so ugly, is there any good way to do this?
```
pip install Resource-0.2.0-py2.py3-none-any.whl --no-index --find-links `pwd`
I find this cmd is ok.
I get this error whenever I try to install any module using pip, but easy_install work perfectly. I have no proxies configured in my Ubuntu 12.04 machine.
Previously it was working fine, just dnt know, how it stoped working suddenly.
This is error i get, while running sudo pip install <any_package_name>:
Exception:
Traceback (most recent call last):
File "/tmp/tmpOA61D3/pip.zip/pip/basecommand.py", line 246, in main
status = self.run(options, args)
File "/tmp/tmpOA61D3/pip.zip/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
File "/tmp/tmpOA61D3/pip.zip/pip/req/req_set.py", line 345, in prepare_files
functools.partial(self._prepare_file, finder))
File "/tmp/tmpOA61D3/pip.zip/pip/req/req_set.py", line 290, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/tmp/tmpOA61D3/pip.zip/pip/req/req_set.py", line 415, in _prepare_file
req_to_install, finder)
File "/tmp/tmpOA61D3/pip.zip/pip/req/req_set.py", line 376, in _check_skip_installed
finder.find_requirement(req_to_install, self.upgrade)
File "/tmp/tmpOA61D3/pip.zip/pip/index.py", line 425, in find_requirement
all_versions = self._find_all_versions(req.name)
File "/tmp/tmpOA61D3/pip.zip/pip/index.py", line 349, in _find_all_versions
index_locations = self._get_index_urls_locations(project_name)
File "/tmp/tmpOA61D3/pip.zip/pip/index.py", line 323, in _get_index_urls_locations
page = self._get_page(main_index_url)
File "/tmp/tmpOA61D3/pip.zip/pip/index.py", line 789, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/tmp/tmpOA61D3/pip.zip/pip/index.py", line 878, in get_page
"Cache-Control": "max-age=600",
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/sessions.py", line 476, in get
return self.request('GET', url, **kwargs)
File "/tmp/tmpOA61D3/pip.zip/pip/download.py", line 367, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/sessions.py", line 464, in request
resp = self.send(prep, **send_kwargs)
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/adapters.py", line 370, in send
timeout=timeout
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 341, in _make_request
self._validate_conn(conn)
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 762, in _validate_conn
conn.connect()
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/packages/urllib3/connection.py", line 238, in connect
ssl_version=resolved_ssl_version)
File "/tmp/tmpOA61D3/pip.zip/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py", line 296, in ssl_wrap_socket
cnx.set_tlsext_host_name(server_hostname)
AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'
I found a potential solution here. Here's the relevant quote:
"That happend because Ubuntu 12.04 (that is my server's OS) has old pyOpenSSL library which not accept attribute 'set_tlsext_host_name'.
For fix that, you need to add dependence pyOpenSSL >= 0.13.
On Ubuntu for update pyOpenSSL use pip, you also need to install libffi-dev and remove python-openssl by apt."
$ sudo apt-get purge python-openssl
$ sudo apt-get install libffi-dev
$ sudo pip install pyOpenSSL
Let me know if this is unclear or if it doesn't work for you.