Unable to get tensorflow working on Mac OSX - python

I am trying to get tensor flow on my Mac OS X Yosemite. I tried it in a number of ways, all of which result in an error.
Method #1: using virtualenv. When I get to the
pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
I get
BadZipFile: File is not a zip file
Method #2: using Anaconda. Again, when within the anaconda environment I do
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl
I get an error, although a different one this time:
SLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
Method #3: using bazel. Numerous dependency issues - e.g.,
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
... no such package '#jpeg_archive// ...
... no such package '#png_archive// ...
etc.
Has anyone been able to successfully build tensorflow on a mac (that's sitting behind a corporate firewall, btw - maybe that's part of the problem). Any insight would be much appreciated.
Thanks!
Natalia

Did you try removing secure to http, something like sudo pip install --upgrade http://... instead (and also, you should try checking pip version too)

Related

Issue with Emscripten installation on mac

this is my first time diving into emscripten and web assembly and I am having some trouble with the installation process. I tried following the directions for mac on emscriptens website and I am able to do the pull command from github with no problem. However when trying to install emscripten with the "./emsdk install latest" command line it keeps failing.
Been at this for hours and I have updated just about everything and re-downloaded python to make sure it is the newest version. This is the error message I am getting:
Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-v14.18.2-darwin-x64.tar.gz': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
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.
error: installation failed!
Any help is much appreciated! Thank you!
Please do not use python2. Install certifi with pip3 install certifi. Then just browse to Applications/Python 3.x and double-click Install Certificates.command
Now you can continue the installation.
Do not use Python 3. You must use Python 2.
python3 ./emsdk.py install latest
python3 ./emsdk.py activate latest
python ./emsdk.py install latest
python ./emsdk.py activate latest
See also Unable to install latest due to SSL certificate verify failed and Emsdk download fails on clean-is macOS Catalina 10.15.1

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.

OpenCV installation failure on windows

Hi I am trying to install opencv on windows. I am using python version 3.7.3. I have tried the installation tutorials using pip, conda and also followed steps outlined in the documentation:https://www.learnopencv.com/install-opencv-4-on-windows/. But no success. I am getting the same error regardless of the approach.
Fetching package metadata ...
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/a
naconda/win-64/repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'tls_process_server_certificate\', \'certificate verify failed\')])")))'))
ERROR: Could not find a version that satisfies the requirements dlib(from versions:none)
ERROR: No matching distribution found for dlib
any suggestions on how to solve this issue.
Looks like Conda installer can't verify SSL certificate.
As a workaround you can use a common way of installing Python packages using pip in OS terminal if you already have Python and pip installed.
Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution)
run pip install opencv-python if you need only main modules
run pip install opencv-contrib-python if you need both main and contrib
modules (check extra modules listing from OpenCV documentation)
After trying number of solutions seen online, I was able to resolve the issue.
conda install opencv worked for me. If anyone gets the same issue, refer to this document for reference. It worked for me and hopefully it works for you as well. The link to the document is: http://mathalope.co.uk/2015/05/07/opencv-python-how-to-install-opencv-python-package-to-anaconda-windows/
Its seems your network is not allowing you to access data from command line, we often see these types of issues when we are using office closed network.
In most cases when we disconnect our machines from office network (or take help from IT team to by pass closed network), pip install starts working.
Can you check if running " pip install pandas" also gives you same error, if so then its definitely network issue.

pip wont install anything getting numerous erros etc

So I have python 2.7
have pip installed
pip is upgraded
cant install anything i get all kinds of errors and have tried all kinds of solutions.
why do i have to type: C:\Users\kingj>python -m pip install
instead of pip install without getting: C:\Users\kingj>pip install
'pip' is not recognized as an internal or external command,
operable program or batch file.
everyone else seems to just type pip install etc... i have to do python -m pip install
then when i do do it like that i get this:C:\Users\kingj>python -m pip install django-json
Collecting django-json
Could not fetch URL https://pypi.python.org/simple/django-json/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) - skipping
Could not find a version that satisfies the requirement django-json (from versions: )
No matching distribution found for django-json
even though i have tried multiple packages by name and i get only that message?!
Sounds like your PATH variable isn't pointing to pip correctly. I'm not sure what the correct directory is in Windows as I'm a mac user. But i would start by looking there. Also, it may be worth uninstalling and reinstalling Python. I know there is a checkbox for updating your PATH variable when you do a fresh install of Python. Also, the newest versions of Python ship with pip correctly installed for you. If that is unsuccessful, check here: How do I install pip on Windows?

Python pip install error [SSL: CERTIFICATE_VERIFY_FAILED]

I have been trying to figure this out for a while now and for some reason I get stuck with an ssl issue and have no idea what is going on.
Problem:
I have installed python2.7 and easy_install2.7, but when trying to install pip with easy_install2.7 I get the following error.
[root#cops-wc-01]# /usr/local/bin/easy_install-2.7 pip
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
It is trying to download, but this SSL cert verification failure is preventing it.
Does anyone know a way around this, or a way to resolve it?
Sorry if it is a noob question :)
[root#cops-wc-01]# uname -a
Linux 2.6.32-504.30.3.el6.x86_64 #1 SMP Wed Jul 15 10:13:09 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root#cops-wc-01]#
Centos 6
apt-get install ca-certificates
If you missed this package.
On my device (that runs nix),
$ date showed ...1969
so I had to set the date to a more recent time :
$ date -s "26 MAR 2017 13:16:00"
Then the SSL error was gone.
YAS (Yet Another Solution)
I had the same issue.
Tried everything above.
My issue was fixed by upgrading pip and setuptools:
$ pip install -U pip setuptools
I also tried to add an entry in my ~/.pip/pip.conf file:
[global]
trusted=https://pypi.your.domain
Most likely pip does not have the required CA certificates to validate that.
You can force pip to use openssl's CAs to see if it helps.
The easiest solution that worked for me:
From https://pypi.python.org/pypi/pip, download 'pip-8.1.2.tar.gz'
Install it with pip, "pip install ./pip-8.1.2.tar.gz"
On the ubuntu server, the new version pip may be installed in a different location. If checking version with 'pip --version', it's still an older version one, like pip 1.5.6. To install a package with the new version pip, straightforwardly use the absolute path for convenience:
/home/tom/.local/bin/pip install ./gensim-0.13.1.tar.gz
Install dependencies one by one, errors like this below can be bypassed.
Download error on https://pypi.python.org/simple/pip/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!"
On macbook put this line in ~/.bash_profile:
export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem
And forget about this error.
Of course, if you don't have openssl - run brew install openssl. And don't forget to do . .bash_profile after first edit of .bash_profile.
I ran the following commands to resolve the issue:
$ curl https://bootstrap.pypa.io/get-pip.py >> get-pip.py
$ python get-pip.py
This upgraded pip to v9.0.3, and this version has no issues.
Since this is currently the top hit on Google for this issue I thought I would share my solution. As weird as it is. I'm on CentOS 7, Python3.6 although I believe it doesn't matter which Python version.
The SSLError / CERTIFICATE_VERIFY_FAILED was also happening for me when I ran a fresh copy of get-pip.py.
The solution was to run the install command with output piped to a file, so python get-pip.py &> output. I haven't had the time to find out why not having a TTY affects the environment for the script.
If you are running behind a web filter or firewall, please ensure SSL inspection/decryption is disabled or bypassed for the domain *.pythonhosted.org (or more specifically, files.pythonhosted.org). May also need to include pypi.org.
I'm running Python on an enterprise workstation and this has been the culprit in our environment across Windows and Linux hosts. Confirmed with our older system, a Broadcom ProxySG on prem web filter appliance, and later through Cisco's Umbrella Cloud Gateway/SIG product.
Cheers
I didn't realize that there is a command "python -M ensurepip after 7.9. This fixed my issue.

Categories

Resources