I am trying to install psutil on my Raspbian VM where I am working on the python code. Later I am planning to upload it to pi.
Every time when I try to install psutil, it gives following error.
pi#raspberry:~ $ pip3 install psutil
Collecting psutil
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 138, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/connection.py", line 75, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
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 281, in connect
conn = self._new_conn()
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 147, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0xb6066dac>: Failed to establish a new connection: [Errno -2] Name or service not known
Here is my pastebin as I can't upload entire error log https://pastebin.com/EyWVmuju
I did some research and realized I need to install 'python-dev' however it didn't helped.
pi#raspberry:~ $ sudo apt-get install python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-dev is already the newest version (3.5.3-1).
python3-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Any help will be appreciated.
Thanks.
Related
i'm trying to install pygame package on my computer which one is not connected to internet.
(env : windows10, python 3.9(anaconda))
so i downloaded a "pygame-2.1.2.tar" file from www.pypi.org and then tried to install it
from cmd with "python setup.py install" commend.
then it shows error message like below
===============================================================================
(base) C:\pythonpackage\pygame-2.1.2>python setup.py install
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Making dir :prebuilt_downloads:
Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip
d561079ec622b0bab5a9e02976f5d540b0622da
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py", line 174, in
_new_conn
conn = connection.create_connection(
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\connection.py", line 73,
in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\ProgramData\Anaconda3\lib\socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11002] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 699,
in urlopen
httplib_response = self._make_request(
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 382,
in _make_request
self._validate_conn(conn)
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 1010,
in _validate_conn
conn.connect()
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py", line 358, in
connect
conn = self._new_conn()
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py", line 186, in
_new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at
0x00000237AF075250>: Failed to establish a new connection: [Errno 11002] getaddrinfo
failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py", line 439, in
send
resp = conn.urlopen(
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 755,
in urlopen
retries = retries.increment(
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 574, in
increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.libsdl.org', port=443):
Max retries exceeded with url: /release/SDL2-devel-2.0.18-VC.zip (Caused by
NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000237AF075250>:
Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\pythonpackage\pygame-2.1.2\setup.py", line 359, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\pythonpackage\pygame-2.1.2\buildconfig\config.py", line 225, in main
deps = CFG.main(**kwds)
File "C:\pythonpackage\pygame-2.1.2\buildconfig\config_win.py", line 497, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\pythonpackage\pygame-2.1.2\buildconfig\download_win_prebuilt.py", line 290, in
ask
update(x86=x86, x64=x64)
File "C:\pythonpackage\pygame-2.1.2\buildconfig\download_win_prebuilt.py", line 273, in
update
download_prebuilts(download_dir, x86=x86, x64=x64)
File "C:\pythonpackage\pygame-2.1.2\buildconfig\download_win_prebuilt.py", line 124, in
download_prebuilts
download_sha1_unzip(url, checksum, temp_dir, 1)
File "C:\pythonpackage\pygame-2.1.2\buildconfig\download_win_prebuilt.py", line 47, in
download_sha1_unzip
response = requests.get(url)
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 542, in
request
resp = self.send(prep, **send_kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 655, in
send
r = adapter.send(request, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py", line 516, in
send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.libsdl.org', port=443):
Max retries exceeded with url: /release/SDL2-devel-2.0.18-VC.zip (Caused by
NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000237AF075250>:
Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))
===============================================================================
please let me know how to install pygame on offline environment.
i need your help!! please~~
Solution 1 (It works for me; simple but tricky)
My first suggestion is just using .whl file. You can download pygame.whl, which is another type of installation file, from another computer and move the two files to the computer with no internect connection.
You can download the files here:
.whl file for Window & Python3.9 (for example,
pygame-2.1.2-cp39-cp39-win_amd64.whl):
https://pypi.org/project/pygame/#files
Actually, .whl is a zipfile. You can unzip the .whl file then you can see three folders: pygame, pygame-2.1.2.data, and pygame-2.1.2.dist-info. You just need pygame folder.
You can copy the folder and paste it to your python project. Then you can simply import pygame. I just tried this way and it works for me. (I even tried to run an example game)
Solution 2
Another suggestion is to download pip and pygame.whl from another computer and move the two files to the computer with no internect connection.
You can download the files here:
pip (for example, pip-22.0.3.tar.gz): https://pypi.org/project/pip/#files
.whl file for Window & Python3.9 (for example,
pygame-2.1.2-cp39-cp39-win_amd64.whl):
https://pypi.org/project/pygame/#files
After downloading and moving the two files to the computer with no internect connection, you first unzip the pip-22.0.3.tar.gz and install pip by tying following command inside of the pip folder (pip also has setup.py file):
python setup.py install
Now, pip has been installed. Then, install using the .whl file using pip in the folder that .whl file exist.
python -m pip install pygame-2.1.2-cp39-cp39-win_amd64.whl
I hope it help you emjoy pygame.
you can run command: pip install pygame
I am running my fastapi via Docker, here is the main.py
import sys
from fastapi import FastAPI
from src.redactor import DSARRedaction
app = FastAPI()
#app.get("/")
async def run_redaction():
DSARRedaction("kulveer").run_redaction()
return {"message": "Redaction Completed"}
and here is the Dockerfile
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt .
RUN apt-get update
RUN apt-get install -y python3-opencv
# Install dependencies for textract
RUN apt-get install -y ghostscript python-dev libxml2-dev libxslt1-dev antiword unrtf poppler-utils flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig \
libpulse-dev zlib1g-dev qpdf
RUN apt -y install tesseract-ocr
RUN apt -y install libtesseract-dev
RUN pip install --upgrade pip && pip install -r requirements.txt
COPY . .
RUN python3 -m spacy download en_core_web_lg
EXPOSE 50
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "50"]
I am trying to run the following python script as I just want to be able to get the URL via python without having to click on it.
import requests
requests.get('http://0.0.0.0:50/')
But every time I try to run that code to request the API, I get the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1011, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 951, in send
self.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f34d008fca0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=50): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f34d008fca0>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "x.py", line 3, in <module>
requests.Session().get('http://0.0.0.0:50')
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=50): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f34d008fca0>: Failed to establish a new connection: [Errno 111] Connection refused'))
Any ideas on why this is happening?
Access your endpoint at http://localhost:50 instead of http://0.0.0.0:50 so it should be
import requests
requests.get('http://localhost:50/')
I'm following this tutorial but when I get to the $VENV/bin/pip install "pyramid==1.10.1" waitress it gives me the following error:
Could not find a version that satisfies the requirement pyramid==1.10.1 (from versions: )
No matching distribution found for pyramid==1.10.1
I'm using a macSierra 10.13.5 running python 3.5.1 (under python3). I can see the package exists on pip because when I try to install in my machine it works. But it won't work when installing inside the virtual environment.
Can you help me, please? I'm going through this tutorial to understand how to run a legacy project I'll have to work on.
UPDATE:
the output when running $VENV/bin/pip install "pyramid==1.10.1" -vvv
Collecting pyramid==1.10.1
Getting page https://pypi.python.org/simple/pyramid/
Starting new HTTPS connection (1): pypi.org
Could not fetch URL https://pypi.python.org/simple/pyramid/: connection error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
1 location(s) to search for versions of pyramid:
* https://pypi.python.org/simple/pyramid/
Getting page https://pypi.python.org/simple/pyramid/
Starting new HTTPS connection (2): pypi.org
Could not fetch URL https://pypi.python.org/simple/pyramid/: connection error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Could not find a version that satisfies the requirement pyramid==1.10.1 (from versions: )
Cleaning up...
No matching distribution found for pyramid==1.10.1
Exception information:
Traceback (most recent call last):
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/commands/install.py", line 294, in run
requirement_set.prepare_files(finder)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/req/req_set.py", line 461, in _prepare_file
req_to_install.populate_link(finder, self.upgrade)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/req/req_install.py", line 250, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/index.py", line 571, in find_requirement
'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for pyramid==1.10.1
Starting new HTTPS connection (1): pypi.org
There was an error checking the latest version of pip
Traceback (most recent call last):
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 341, in _make_request
self._validate_conn(conn)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 761, in _validate_conn
conn.connect()
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connection.py",line 238, in connect
ssl_version=resolved_ssl_version)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 279, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 376, in wrap_socket
_context=self)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 747, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 983, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 628, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py", line 370, in send
timeout=timeout
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 574, in urlopen
raise SSLError(e)
pip._vendor.requests.packages.urllib3.exceptions.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/utils/outdated.py", line 126, in pip_version_check
headers={"Accept": "application/json"},
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 477, in get
return self.request('GET', url, **kwargs)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/download.py", line 373, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 594, in send
history = [resp for resp in gen] if allow_redirects else []
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 594, in <listcomp>
history = [resp for resp in gen] if allow_redirects else []
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 196, in resolve_redirects
**adapter_kwargs
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/Users/andredx/Projects/python/quick_tutorial/env/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
pip._vendor.requests.exceptions.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645)
You need to use the get-pip [1] script to install a newer version of pip. Yours is outdated enough that it can no longer talk to PyPI due to security upgrades over the past few years. This means that your version of pip is old enough that it cannot upgrade itself via pip install -U pip. You'll need to use the get-pip script.
https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line
Seems like search is causing an SSL error, when attempting to do an install it couldnt find the right package. When i did a search it is giving an ssl issue
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)
and lastly if i try to upgrade pip in an attempt to resolve the issue, it also has a SSL issue:
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
EDIT This looks like an outdated SSL issue related to openessl due to my mac. That being said, it might be a duplicate of ssl.SSLError: tlsv1 alert protocol version but i am attempting to follow it in order to resolve it.
This is a 2 pronged answer.
1: Update openssl.
brew update
brew install openssl
2: to get gitPython, pip will still fail. The issue is that for some reason despite gitpython working for 2.7, it doesnt like it. I confirmed that pyton3.6 -m pip install gitpython works, but when doing it in pip using 2.7,
pip --version
pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)
pip install gitpython
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/smmap'
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
When attempting to upgrade pip i didnt have authority, and similarly when I sudo pip, it didnt like it either.
Ultimately, Since i am a 3.6 person, this solved my issues but I wanted to give insight for people using 2.7 for some reason.
Whenever I try to install any package from pip (Flask, Github-Flask, Django even upgrading setuptools), I always am faced with this error:
File "/usr/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/usr/lib/python2.7/httplib.py", line 561, in read
s = self.fp.read(amt)
File "/usr/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/usr/lib/python2.7/ssl.py", line 241, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 160, in read
return self._sslobj.read(len)
error: [Errno 104] Connection reset by peer
I am using Kubuntu 12.04, python 2.7. I have already tried reinstalling python2.7 and pip. Any ideas?