issues during jupyter install using pip on Python 2.7.3 - python

We are using python 2.7.3 and do not have Anaconda available for install in the organization approved package list. So we have been trying to manually install the dependencies using unofficial windows binaries provided by Christoph Gohlke. Currently we are stuck at installing terminado-0.8.1-py2.py3-none-any.whl. This needs a pywinpty package which is not available for Python 2.7.
We would appreciate any suggestions on how to proceed.
We would like to get Jupyter installed using any other possible option for python 2.7.3
installing jupyter using pip gives below error so we went with manual route to install individual packages
60: InsecurePlatformWarning: A true SSLContext object is not available. This pre
vents urllib3 from configuring SSL appropriately and may cause certain SSL conne
ctions to fail. You can upgrade to a newer version of Python to solve this. For
more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.ht
ml#ssl-warnings
InsecurePlatformWarning
Could not fetch URL https://pypi.org/simple/jupyter/: There was a problem conf
irming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max
retries exceeded with url: /simple/jupyter/ (Caused by SSLError(SSLError(1, '_ss
l.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol
version'),)) - skipping
Could not find a version that satisfies the requirement jupyter (from versions
: )
No matching distribution found for jupyter

You can:
Go to Python root folder and run the "Install Certificates.command" file.
Upgrade python version to 3.X.X and reinstall. You may follow https://www.youtube.com/watch?v=BVS3U1OQzO4

this worked for me on WIndows 10:
explicitly installing an older version of the package
PS> python2.exe -m pip install pywinpty==0.5.1
PS> python2.exe -m pip install notebook
PS> python2.exe -m pip install jupyter
Zero errors.
Reference:
https://pypi.org/project/pywinpty/0.5.1/

Related

How do I uninstall Python 3.9.1 from my Coral Dev Board?

I installed python3.9.1 on the Coral Dev Board using the instructions from:
https://linuxize.com/post/how-to-install-python-3-9-on-debian-10/
I did this because I was unable to locate a compiled package to install using pip or apt.
I had been using python 3.7 with an OpenCV program I was working on but I kept getting an error "Unable to initilize Qt platform plugin" with a recommendation to reinstall. I was also unable to upgrade python 3.7 to python 3.9.1.
I experienced a build error during the installation:
"Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381"
The build completed otherwise and I installed it. Python3.9.1 shows up as the current version (python 3.7 has NOT been uninstalled). I created a virtual environment and began trying to use pip install python packages like numpy. But I get the error:
"There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/(Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) -skipping"
I have found several posts about this SSL problem but not yet a fix for it.
So the new python3.9.1 installation is useless to me. Furthermore, researching this topic on this site, I've learned that Tensorflow is incompatible with python3.9.1 so Id like to remove it if only to recover the space it occupies.

Default PIP in python virtual environment is ancient, how to fix it?

I used python3 -m venv to create a virtual environment, in that virtual environment my settings are:
python 3.5.2
pip 8.1.1
Mac OS 10.13.6
That pip version is extremely OLD and leads to a problem described below: how do I get venv to install a newer version of pip?
Whenever I run "pip install " I get an error of the form:
Could not fetch URL https://pypi.python.org/simple/<any_package>/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
I have tried this with = flask, gunicorn, and requests and believe that it's not a package specific problem.
What I tried to fix the problem:
I came across this link which suggested I should upgrade pip somehow: https://github.com/pypa/pip/issues/5226
So I upgraded pip up to the latest version:
pip 20.0.2 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip (python 3.5)
But the problem persisted. So then I upgraded venv to the latest version.
But the problem persisted again.
I did some more research online and came across the following github issue: https://github.com/pypa/pip/issues/5363
Which had as part of the problem statement text very similar to my TLS issue, but none of the answers there seemed to be able to fix the problem (pasting each one resulted in the same TLS issue).
Finally I found something that worked:
From this question: Upgrading pip/installing django - [SSL: TLSV1_ALERT_PROTOCOL_VERSION]
The solution below:
curl https://bootstrap.pypa.io/get-pip.py | python3
Upgrades my "virtual enviromnet's pip" to the correct version. But I yet to figure out how to get my default pip (when I create a new virtual environment) to be up to date.
As of today, it is not possible.
Starting with Python 3.9 it should be possible to do something like path/to/pythonX.Y -m venv --upgrade-deps .venv, and that would upgrade pip and setuptools in the newly created virtual environment:
https://bugs.python.org/issue34556
https://github.com/python/cpython/pull/13100
https://docs.python.org/3.9/library/venv.html
You could try virtualenv instead, if it suits your workflow better. As far as I know it tries to always install the latest version of pip in the virtual environments it creates.
https://pypi.org/project/virtualenv/
There is an example of code at the end of venv's documentation showing how to create a tool that downloads and installs up-to-date pip and setuptools:
https://docs.python.org/3/library/venv.html#an-example-of-extending-envbuilder
User wim made an interesting suggestion here:
https://stackoverflow.com/a/60217751
I have a tool called ve that does something similar:
https://pypi.org/project/ve/
There are some answers to similar questions, suggesting to modify the wheel files bundled with ensurepip in Python's standard library, but I wouldn't recommend that.
Similar questions:
How to get "python -m venv" to directly install latest pip version
Why 'python3 -m venv myenv' installs older version of pip into myenv than any version of pip I can find anywhere on the system?

How to trust host using pip 1.4.1

I am stuck using pip 1.4.1 and have run up against a problem when upgrading package.
Could not fetch URL https://pypi.python.org/simple/pymongo/: There was a problem confirming
the ssl certificate: <urlopen error [Errno 1] _ssl.c:509: error:1407742E:SSL
routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version>
I have seen that later versions of pip you can do --trusted-host to ignore the certs warning. But on 1.4.1 it appears that this option is not available. How to fix?
The worst problem in your case is not untrusted host, the worst problem is too old versions of Python and OpenSSL. Your pip tried to use protocol version TLS v1 which PyPI stopped supporting long ago.
To install packages over the Net you need to upgrade OpenSSL, Python and pip. If you cannot upgrade you cannot install from PyPI directly. Then you can try to download packages from PyPI using a browser and install them from the local filesystem.
You can also use pip download on a host with more modern OpenSSL/Python/pip, transfer downloaded packages to the ancient host and install them there. See https://stackoverflow.com/a/14447068/7976758

issue with emsdk on mac

I am trying to setup emsdk on mac with the following command:
./emsdk install latest
I cloned the repo from git. However, I get the following error upon running the command mentioned above:
** NOTICE **: The default SDK changed from `fastcomp` to `upstream`.
If you have problems, or wish to revert back to fastcomp for some other reason
you can add `-fastcomp` to explicitly install that fastcomp-based
SDK, .e.g ./emsdk install latest-fastcomp.
Installing SDK 'sdk-releases-upstream-b024b71038d1291ed7ec23ecd553bf2c0c8d6da6-64bit'..
Installing tool 'releases-upstream-b024b71038d1291ed7ec23ecd553bf2c0c8d6da6-64bit'..
Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/b024b71038d1291ed7ec23ecd553bf2c0c8d6da6/wasm-binaries.tbz2': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>
Warning: Possibly SSL/TLS issue. Update or install Python SSL root certificates (2048-bit or greater) supplied in Python folder or https://pypi.org/project/certifi/ and try again.
Installation failed!
I have tried running the following to fix this but it did not solve the issue.
pip install certifi
Any other suggestions to fix the issue would be quite welcome.
I was able to upgrade the python version to 3.8.0 using pyenv. The upgrade helped me with the certificate issue.
brew install pyenv
pyenv install 3.8.0
pyenv global 3.8.0
or if inside the emsdk directory:
pyenv local 3.8.0
The command ./emsdk install latest ran successfully after the python upgrade.

"pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

I have the anaconda package and run Spyder. Here is my system information:
anaconda 2018.12 py37_0
Python 3.7.1
pip 18.1
Dell Inspiron 13 7000 64-bit
I am unable to install anything with pip from the command prompt. I get the following when trying to install numpy for instance (which I already have through anaconda):
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Requirement already satisfied: numpy in c:\users\uday rallabhandi\anaconda3\lib\site-packages (1.15.4)
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Please help me understand why this is happening.
Here was my process to correct the error, on Windows 10 with Anaconda:
Added the following paths to my environment variables:
/AppData/Local/Continuum/Anaconda3
/AppData/Local/Continuum/Anaconda3/Scripts
/AppData/Local/Continuum/Anaconda3/Library
/AppData/Local/Continuum/Anaconda3/Library/Bin
At this stage, the error message was still there.
From Anaconda Prompt, I installed the latest version of pip:
python -m pip install --upgrade pip
This appeared to correct the DLL conflict.
I had exactly the same problem. My computer is exactly the same and the versions of Python and pip are also the same.
It's a dll conflict with libeay32.dll.
I can solve this problem by adding dir path of python which has libeay32.dll (in my case C:\Users\Gabriel\Anaconda3\pkgs\openssl-1.1.1a-he774522_0\Library\bin) in system environment as topmost position.
Try your install/update with pip3 instead of pip.
I do not have libeay32.dll in bin folder either, but after adding C:\Users\<user name>\Anaconda3\pkgs\openssl-1.1.1a-he774522_0\Library\bin to the top of path, it is working. This is on Windows 10 64-bit.
I had the same issue when I created a new environment in anaconda, activated it and tried to install a library with pip. What was missing was:
conda install pip
then everything worked for me.
Activate your base conda environment:
conda activate base
Adding "<Path to miniconda or anaconda>\Library\bin" folder to PATH solved this problem for me.
Add <Path to miniconda or anaconda>\Library\bin folder to PATH
or
cd <Path to miniconda or anaconda>\Library\bin>
Activating the base and then activated my Django environment.
(Django_env) (base) C:\virtual_environment\Django_env> , which actually worked for me.

Categories

Resources