I am getting the following error while trying to install Django for python3
(base) C:\ShashiPractice ProjectStudent>pip install django
Collecting django
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
...
...
...
y failed: self signed certificate in certificate chain (_ssl.c:1056)')))
You made a small mistake.
The pip command is as follows:
pip install Django
Note that the the D in Django is in block letter. Hope this solves your problem :)
Related
The gitlab build fails with the following error:
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/asgiref/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/asgiref/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/asgiref/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/asgiref/
ERROR: Could not find a version that satisfies the requirement asgiref (from versions: none)
ERROR: No matching distribution found for asgiref
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
Cleaning up file based variables
ERROR: Job failed: command terminated with exit code 1
My Dockerfile is the following:
FROM registry.ubitech.eu/public-group/ubitech-public-registry/python:3.8
COPY manage.py gunicorn-cfg.py requirements.txt ./
COPY core core
COPY routers routers
COPY data_utilities data_utilities
COPY datasets datasets
COPY monitoring monitoring
RUN pip install -r requirements.txt
COPY cron_3.0pl1-137_amd64.deb ./
RUN dpkg -i cron_3.0pl1-137_amd64.deb
RUN mkdir logs
RUN touch logs/onenet_dashboard.log
EXPOSE 5005
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]
It is the first time that the build fails. Any idea of what is going wrong here?
I am building my first docker install as part of learning django. I have my docker install working. docker info is ok. and hello-world says successfull. But when I run the Dockerfile suggested by the turorial in my Django 3.0 Pro Book by Will Vincent. I get what look like a network dns error.
################
Error:
Step 6/7 : RUN pip install pipenv && pipenv install --system
---> Running in 585e5020f53a
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f339144df10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pipenv/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f3391f05a90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pipenv/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f3391f05e90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pipenv/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f3391f05ad0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pipenv/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f33915ddd90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pipenv/
ERROR: Could not find a version that satisfies the requirement pipenv (from versions: none)
ERROR: No matching distribution found for pipenv
The command '/bin/sh -c pip install pipenv && pipenv install --system' returned a non-zero code: 1
####################
Dockerfile try to build:
Pull base image
FROM python:3.7
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
WORKDIR /code
# Install dependencies
COPY Pipfile Pipfile.lock /code/
RUN pip install pipenv && pipenv install --system
# Copy project
COPY . /code/
It is failing on the RUN pip install.... line.
I have added dns nameserver entries directly into my /etc/resolver.conf file as other have suggested in my search here. not worked.
I assume there is some issue within Docker trying to run pip in the container? This is my first Docker install so exhausted search for answer.
On OS version Centos8
Thanks
bill sanderson
Ok, we can try a couple of things. First thing I would do:
In the Dockerfile add this(with google's dns):
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf && pip install pipenv && pipenv install --system
It is important to do in the same RUN command.
Another option is:
docker build --network=host -t yourimage:yourversion .
I had the same issue last night - and this morning. Even after rebooting and trying to stop/start the service. This is on my Windows 10.
I did notice running a docker info output the following error:
Error response from daemon: open \\.\pipe\docker_engine_linux: The system cannot find the file specified
As detailed here - https://stackoverflow.com/a/74098179/405022
Having ran wsl --shutdown and being prompted to restart docker desktop, I then proceeded to try my docker build.
docker build -f ./sources/service1/deploy/dev.dockerfile ./sources/service1 -t acme-app.service1-py:latest --no-cache --progress=plain
Coincidence? It worked for me in the end.
I have Python2.7 & Python3.8 installed on my computer with pipenv. I managed to create a 2.7 project by running the following command:
pipenv --two install
pipenv shell
> python --version
> > Python 2.7.15
But when I tried to install a new dependancy using pipenv I got an TLS error due to SNIMissingWarning:
pip install pylint
...
[pipenv.exceptions.InstallError]: ['Collecting astroid==1.6.6 (from -r C:\\Users\\aymeric\\AppData\\Local\\Temp\\pipenv-pktqf1dv-requirements\\pipenv-66rq3_4k-requirement.txt (line 1))', " Could not fetch URL https://pypi.org/simple/astroid/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/astroid/ (Caused by SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping"]
[pipenv.exceptions.InstallError]: ["DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020.
Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support", 'c:\\users\\aymeric\\.virtualenvs\\firmware-pjqfwcnq\\lib\\site-packages\\ pip\\_vendor\\urllib3\\util\\ssl_.py:365: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server 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 validation failures.
You can upgrade to a newer version of Python to solve this.
For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings', ' SNIMissingWarning', 'c:\\users\\aymeric\\.virtualenvs\\firmware-pjqfwcnq\\lib\\site-packages\\pip\\_vendor\\urllib3\\util\\ssl_.py:149: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
Which is odd because SNIMissingWarning should have been patch in 2.7.9 as explained in this link
If remote repositories are now unreachable from 2.7 virtualenv how can you do?
Kinds regards
$ pip3 install django
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after
connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django
I have tried various solutions. I installed python3.7 and then tried but same.
I also tried this but the result was also same.
$ sudo apt-get install python3-setuptools ca-certificates
and same thing happens when I install django in a venv. Same goes for the installing a specific version of django.
I am using Ubuntu, yet, i solved this just running updates, then fixing dpkg configure -a, it seems installed all the certificates, then upgrade.
I have springboot project in gitlab that I try to deploy to Amazon Elastic Beanstalk environment that I created via Amazon web console.
In gitlab I am using Default shared Runners.
to deploy to AWS I must use 'eb' cli, for this I also need python
I tired to use this in my .gitlab-ci.yml
deploy:
stage: deploy
image: python:3.7.2-alpine3.7
script:
- pip install -r awsebcli
- eb use myenv-env -v
- eb deploy myenv-env -v
But got errors:
Pulling docker image python:3.7.2-alpine3.7 ...
Using docker image sha256:00be2573e9f79754b17954ba7a310a5f70c25b6f5bb78375e27e9e86d874877e for python:3.7.2-alpine3.7 ...
Running on runner-0c303413-project-4590-concurrent-0 via ed06f0845ef4...
Fetching changes...
Removing .m2/
Removing target/
HEAD is now at 5c19020 aws1
Checking out 5c190200 as master...
Skipping Git submodules setup
Checking cache for default...
Successfully extracted cache
Downloading artifacts for build (14719)...
Downloading artifacts from coordinator... ok id=14719 responseStatus=200 OK token=Yy7j2TGy
$ pip install -r awsebcli
Could not open requirements file: [Errno 2] No such file or directory: 'awsebcli'
ERROR: Job failed: exit code 1
Update
when I changed the line into:
pip3 install awsebcli
got:
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe6611ff2e8>: Failed to establish a new connection: [Errno -2] Name does not resolve')': /simple/awsebcli/
Could not find a version that satisfies the requirement awsebcli (from versions: )
No matching distribution found for awsebcli
The problem was proxy.
I added this:
pip3 --proxy=myProxy:myPort install awsebcli --upgrade