How to install tqdm on a linux server without internet access? - python-2.7

I am trying to install the python package tqdm on a linux server.
However, the said server has no internet access. Hence, I am unable to install it using pip. I am also unable to find the tqdm package in Debian's package index.
However, what I am able to do is scp files from my local machine to the server. My local has full internet and sudo access.
Any leads please?
Note: I have sudo access on the server.

You could install it with pip. Just use the available commandline options as follows:
pip --no-index --find-links /path/to/directory/with/egg tqdm
Documentation:
https://pip.pypa.io/en/stable/reference/pip_wheel/#no-index
https://pip.pypa.io/en/stable/reference/pip_wheel/#find-links

Related

Installing Python Libraries in VM Instance

I have created a VM Instance on Google Cloud, and wrote some code in it. I import a library in my code which has not been installed in the VM instance. How can I install the library in the VM Instance now?
Google searches show links to install python packages in notebooks but none of them explain how to do it in VM Instances.
Google Cloud Shell
If you are trying to install Python dependencies within your GCE instance, I would just SSH into your instance, then once inside the Cloud Shell, install pip, which is Python's package manager, using the following commands:
sudo curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py
After this, for example, if you would like to import Beautifulsoup library (or any other library) in your code, you would run the following command in the command line to install the library:
sudo pip install beautifulsoup4
In your code
Just import the following in your Python code to have access to the library:
from bs4 import BeautifulSoup

ModuleNotFoundError: No module named 'fuse'

I have set up a GPU Jupyter Notebook VM using the AI platform on Google Cloud. The server runs Debian stretch.
I want to mount a bucket I've created called example onto a folder called /home/jupyter/transfer. I've been following the instructions outlined here but when I run gsfuse example /home/jupyter/transfer I get the error:
ModuleNotFoundError: No module named 'fuse'
I've installed fuse with:
sudo apt-get install fuse
which is successful but the gsfuse code still doesn't run. I then installed the pip package with:
pip install fuse-python
And it still wouldn't work.
Any ideas?
After a lot of trial and error I managed to figure this out. The problem was the python package and where I was installing it.
If you do:
sudo apt-get install fuse
pip install -U fusepy --user
gsfuse example /home/jupyter/transfer --background
It'll work (where --background) runs the mount in the backgroud.

How to add user made scripts to EC2 ubuntu?

I have created an EC2 instance on AWS and I want to transfer some scripts into the site-packages of python3. I can't seem to find a way to do this. Some functions from these files are used by the scripts I am looking to run.
I tried SFTP but it wont allow me to get into the folder just tried to download it.
I am on Ubuntu.
Thanks
Best option to install any service or program in python on a linux server is to create a regular user and then create a virtualenv on a private directory. There, you can freely install any script or package and give the proper rights to specific services/directories of your server.
Install also basic packages in order to run python environment:
sudo apt-get install -y build-essential python-dev python-setuptools zlib1g-dev python-pip

Cascade dependencies when add python packages to my app libraries

I'm trying to add python packages to my Choregraphe app because some packages that are installed by default with python 2.7 aren't in python embedded in Choregraphe.
I want to add urllib3 and certifi to my app to be able to sen HTTPS requests and verify SSL certificates.
So I added a lib folder to my app with the necessary packages, it works fine for urllib3 but to verify SSL certificates I got a cascade of dependencies so I don't manage to do what I want.
Does anyone know if there is a way to access manually the default python version accessible by my Robot so that I can send my request with these packages ?
Thanks in advance !
If you're running this on a Pepper with NAOqi 2.5, pip is installed on the robot; though you'll need to upgrade it:
pip install --user --upgrade pip
and then you can run
/home/nao/.local/bin/pip install --user urllib3 certifi
Then you don't need to package those files in your choregraphe package.
It won't work on the virtual robot (but then you can just add the real path of those libraries to sys.path), and it means you'll have to do this procedure yourself if you want to install your app on a new robot, which can be a hassle.

How to install Graphlab Create on Ubuntu?

When i am trying to install Graphlab Create, it's just retrying connections. I have healthy broadband wifi connection at my home (NO proxy).
Error: (graphlab)ankit#ankit21:~$ pip install graphlab-create==0.9.1
Collecting graphlab-create==0.9.1
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fd6a16ae850>, 'Connection to 192.168.16.253 timed out. (connect timeout=15)')': /simple/graphlab-create/
The proxy 192.168.16.253 is proxy of my college internet. But i have changed the setting in networks setting to automatic proxy. Others installs in terminal are working properly only this is having the problem.
You need your specific academic license key, but trying to install the older version automatically updates your install to 1.7.1. If you choose to copy your code from the installation instructions and you remove --upgrade, and change to 0.9.1 it will still not work.
pip install --no-cache-dir https://get.dato.com/GraphLab-Create/0.9.1/your_key/GraphLab-Create-License.tar.gz
You can obtain your key for the latest version when you register with GraphLab on the Dato website. The academic license is free for each user for one year.
On the official site (https://turi.com/download/install-graphlab-create.html?email=**YOU**%40gmail.com&key=**7C68-...-D3D7**) we have:
Registered email address: YOUR_ADDRESS
Product key: YOUR_PRODUCT_KEY
Installing with dependencies:
Install Anaconda
bash /path to download file/Anaconda2-4.0.0-Linux-x86_64.sh
Create conda environment
conda create -n gl-env python=2.7 anaconda=4.0.0
source activate gl-env
Ensure pip version >= 7
conda update pip
Install GraphLab Create
pip install --upgrade --no-cache-dir https://get.graphlab.com/GraphLab-Create/2.1/YOUR_ADDRESS/YOUR_PRODUCT_KEY/GraphLab-Create-License.tar.gz
Ensure installation of IPython and IPython Notebook
conda install ipython-notebook