cffi.error.VerificationError (undefined symbol: SSLv2_client_method) when running Google Cloud Datalab notebook - ssl

I'm trying to run this notebook on Google Cloud Datalab: https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/courses/machine_learning/feateng/feateng.ipynb
While it was perfectly working yesterday, today running the first block results in cffi.error.VerificationError (undefined symbol: SSLv2_client_method).
Can you advise on how I can fix this?
I've tried to do the same from a different GC profile and the problem remains.
I've also tried to fix 'pip install' as described here: pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)". Doing this in Datalab causes the same error; doing this in Cloud shell outside Datalab doesn't change anything.

This has been answered on github by #ekuuni:
https://github.com/GoogleCloudPlatform/training-data-analyst/issues/313
%%bash
source activate py2env
conda install -y pytz
conda update -y pyopenssl
pip uninstall -y google-cloud-dataflow
pip install --upgrade apache-beam[gcp]
I needed these 2 more lines for it to work.
pip install tensorflow_transform
pip install tensorflow==1.9.0
A good workaround is using virtual environments rather than Datalab so you don't have to deal with version updates:
https://cloud.google.com/dataflow/docs/quickstarts/quickstart-python
I have successfully installed the following on python 2.7
apache-beam==2.7.0
tensorflow==1.11.0
tensorflow-transform==0.8.0

Related

Google Colab: trying to run manim generated TypeError: __init__() got an unexpected keyword argument 'html_attributes'

New to this. I'm trying to install manim in Google Colab following the instructions from the Manim Community site.
Ran:
!sudo apt update
!sudo apt install libcairo2-dev ffmpeg texlive texlive-latex-extra texlive-fonts-extra texlive-latex-recommended texlive-science tipa libpango1.0-dev
!pip install -U manim==0.3.0
!pip install IPython --upgrade
returned the following error;
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
google-colab 1.0.0 requires ipython~=7.9.0, but you have ipython 8.9.0 which is incompatible.
I wasn't aware that I had any version of Python installed
I do not know what to do as I have no experience in this area.

No module named tensorflow even after installing with pip

I'm trying to follow this guide to test this new algorithm: https://github.com/lalonderodney/SegCaps
I can't do it in my PC, so i'm using another server with Putty. Now I'm connected with the other server.
First of all I installed TensorFlow as indicates in the guide with :
pip install -r requirements.txt
After I wrote this code: ./main.py segcaps.png
in which segcaps.png is the image that i want to use
Finally I wrote python main.py --data_root_dir data
that is the only required parameter with the directory containing imgs and masks folders.
Now it gives me an error:
ModuleNotFoundError: No module named 'tensorflow.python.framework'
I searched it in the directory tensorflow/python/framework and it exists.
So, i don't know how to solve it. Ideas?
If you have multiple Python versions installed, then you'll (most likely) have multiple pip versions installed too. Make sure that the pip command you use installs the package(s) into the Python version you want it to. It may so happen that the package got installed into python2 but you wanted it in python3.
Since using pip did not install the packages in python3, pip3 is most likely to the PyPI for python3. Try
pip3 install -r requirements.txt
and that should work.
In case you have an EnvironmentError you can try this (bad idea):
pip3 install -r requirements.txt --user
This solves the problem most of the times on standalone machines. I'm not sure about the server; insufficient permissions might block this.
Why is the --user flag a bad idea? Read: What is the purpose “pip install --user …”?
You can use pip show tensorflow to see if it is installed or not.
As for ModuleNotFoundError try uninstalling keras and reinstalling an earlier version by pip install keras==2.1.6

pip install tensorflow fails - MAC OSError: [Errno 13]

I am trying to install tensorflow on mac Sierra. When I run pip install tensorflow I get following report.
It works fine for me by using command :
pip3 install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.1-py3-none-any.whlrflow-1.10.1-py3-none-any.whl
run sudo pip install tensorflow
The problem appears to be, that you have not got the rights to install tensorflow globally. Therefore, one solution appears to be, that you try to install tensorflow locally using the following command:
pip install tensorflow --user

Downloading PostgreSQL Mac Download Error

could you please advise me of a solution you may know for downloading PostgreSQL. I am trying to install 9.6.5 version, but also tried the 10.0, same error.
I am using an installation option for Mac operating system OS Sierra from website: https://www.openscg.com/bigsql/postgresql/installers.jsp/
I am getting an error:
Have tried to run the instruction sudo easy_install pip in the command line and it installs the pip file successfully. However I am still unable to install the PostgreSQL.
Please could you advise what the issue may be?
I have also installed Homebrew (it did not help).
I do already have anaconda and Python installed, as well as latest versions of R and RStudio.
I have now found a solution to the above problem (on Mac). Execute the following command in your terminal:
sudo easy_install-2.6 pip
If that does not work execute:
sudo easy_install-2.7 pip
This allows the PostgreSQL to be downloaded correctly.
I followed the instructions suggesting using easy_install-2.7 but still got an error very similar to that from the OP. I had to specifically install pip 9.0.0 with
sudo easy_install-2.7 pip=9.0.0
after which the PostgreSQL install worked.
The default pip is now v10, so it's probably a string compare issue in the installer.
Here is the solution that worked for me on Mac High Sierra 10.13.4:
Clear out the brew cache $ rm -rf ~/Library/Caches/Homebrew
Clear out the site-packages $ sudo rm -rf /usr/local/lib/python2.7/site-packages
Reinstall Python $ brew reinstall python This pulls down python-3.5.6.high_sierra and put it in /usr/local/bin/python3
But which python still shows /usr/bin/python
The solution is to run $ brew install python#2 which pulls down python#2-2.7.14_3.high_sierra
Now which python shows the correct path /usr/local/bin/python which is also where all your pip stuff is installed, so now pip will work.
Ensure the latest version of pip is installed with $ sudo pip install --upgrade pip

Installing Tensorflow 1.3 (No module named tensorflow)

I am initializing a new VM with Ubuntu 17 on Google Cloud Platform, I then SSH into the newly created VM, upload this script and run it...
#! /bin/bash
sudo apt-get install python-pip
sudo pip install --upgrade pip
sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Now, this works for me, when I launch a Python interactive environment
import tensorflow as tf
does not throw an error, however, if I run the same script but replace
tensorflow-0.5.0-cp27-none-linux_x86_64.whl
with
tensorflow-1.3.0-cp27-none-linux_x86_64.whl
I get:
ImportError: No module named tensorflow
... incredibly frustrating, especially since the contrib library doesn't seem to be apart of the 0.5 version... any ideas of what is going on, perhaps how I can first install 0.5 and then upgrade to 1.3 ?
I also get the same then i tried pip install tensorflow after worked fine