ModuleNotFoundError: No module named 'fuse' - google-cloud-platform

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.

Related

How do I permanently install an apt package in Google Cloud Shell?

I tried to install a package with apt-get cloud shell once but the next day it was gone. I saw another stackoverflow here. But it was out of date (I think). Please help.
As you can see from the link #DazWilkin has provided, the only directory where Cloud Shell persists your file is at $HOME directory. Anything installed with apt will not persist when the instance provisioned in Cloud Shell shuts down.
There's a solution for this problem. The script $HOME/.customize_environment runs everytime you boot up Cloud Shell. It is already running as root and there you can run apt to install the packages you want.
Example, as per doc:
#!/bin/sh
apt-get update
apt-get -y install erlang
Update: There seems to be an issue where .customize_environment is not working. It's been confirmed by a Google Engineer and it's currently being fixed.

Installing requirements with pip in an environment terminates (2.7)

I'm trying to setup my work environment on my new MBP M1. The executable is python2.7, so I've been trying to create a virtualenv and install the requirements.
Alas, I can not.
I create an environment, and get the output:
virtualenv env
created virtual environment CPython2.7.16.final.0-64 in 183ms
creator CPython2macOsFramework(dest=/Users/v/dev/skolplattformen/env, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, wheel=bundle, setuptools=bundle, via=copy, app_data_dir=/Users/v/Library/Application Support/virtualenv)
added seed packages: pip==20.3.3, setuptools==44.1.1, wheel==0.36.2
activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
Then I activate that environment, and try to pip install the requirements.
Although, I get this
1716 killed pip2.7 install -r requirements.txt
I can't find anything in system.log, I can't find what process 1716 is...
which pip2.7 points to the right place, although which pip, in the environment, says pip: aliased to noglob pip.
I can't execute a python script either in the environment, or open a repl, it gives the same kill message.
I had the same problem. I solved it by downloading Python 2.7 from https://www.python.org/ to replace the system's default.

In Windows 10, pip import error: cannot import name main after installing pipenv

I am trying to use pipenv as well as pip and having some issues. I installed pipenv using pip. I installed pipenv using pip. Then I went back and tried to run pip -v and got the following: ImportError: cannot import name main. I have seen this question answered for Linux and Mac, but I cannot use sudo or which commands; I am on Windows 10 using the CMD console. In my scripts folder, I see pip, pip2.7, and pip2. I cannot remember which one was my system pip. I know I need to maybe uninstall and reinstall (I have already tried to upgrade, but of course, without pip running you can't upgrade pip). I don't want to make more of a mess, so I wanted to ask how to resolve this in the CMD console on Windows.
Apparently, when I installed pipenv, it changed the system pip version that I was previously using. For some reason, all of the answers I found were using Linux or Mac, but here is how I resolved it. Simply open your command prompt and type:
$python -m pip uninstall pip
Then, test that you still have your old version installed by typing:
$pip -V
This showed me that I had gone from using pip version 18 back to using version 8.1.1. You should then be able to proceed to other tasks using pip.

Installing numpy on Amazon EC2 virtualenv

I'm trying to build a virtualenv that uses python27 in a virtualenv on an Amazon EC2. Research on the web indicated messing with the preinstalled Python26 is a bad idea so I wanted to work in a safe virtual env. Here are all of my commands starting from a fresh instance on EC2
sudo easy_install python27
sudo easy_install virtualenv
yum groupinstall "Development Tools"
mkdir virt_env
virtualenv -p python27 virt_env/py27
And this all seems to work great. When I activate my virtualenv Python27 is the default, and outside of it Python26 is the default. So far so good. Next I tried iPython in the virtualenv
source virt_env/py27/bin/activate
pip install ipython
This works great, again ipython is available in the virtualenv and not available outside of it. However when I go to install numpy in the virtualenv I get the follwing:
pip install numpy
// Lots of output that I won't paste all of it, main error below
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
Not sure what I'm doing wrong because I've always installed numpy on virtualenv this way. Any help would be greatly appreciated thanks
EDIT: I've also tried using:
sudo yum install python-devel
in the virtualenv. Still no help
Was able to answer my own question. To install the python dev correctly I needed:
sudo yum install python27-devel

How can I install python-Orange on ubuntu 12.10

sudo apt-get install python-Orange
or
sudo apt-get install python-orange
doesn't work
sudo python setup.py install
sudo python setup.py build
is not working as well.
Can anyone help??
Python has two tools for easy installation of all programs that are listed on the Python Package Index, also known as PyPi: These are easy_install and pip. Both retrieve very recent versions of Orange (and of any other package that is updating its PyPi entry regularly).
I installed Orange on Ubuntu 12.04 (LTS) with
pip install orange.
You will see lots of log lines indicating that Pip is downloading and compiling Orange for you. Simply wait. When pip is ready, fire up python and try to import orange. If that works, quit python and try the GUI with python /usr/local/lib/python2.7/dist-packages/Orange/OrangeCanvas/orngCanvas.pyw (you probably want to create a shell alias or bash script for that one :-)
NOTE: on 12.04 I needed to first upgrade 'distribute' itself with sudo easy_install -U distribute but this was clearly indicated by pip.
https://pypi.python.org/pypi/Orange/2.6/
You need to extract the dowloaded tarball on that page to a folder and then change directory to that folder. Then the sudo python setup.py... instructions will work (but you should 'build' the application before you 'install' it).
go to the given link "https://pypi.python.org/pypi/Orange/2.6/"
download the package and extract the file
install with given command
python setup.py build
python setup.py install
note:- during installation make sure that your net is working because it downloads required packages. Also it may ask for C++ or gcc compilers while installing and could be terminate just read the errors care fully and install requires packages from the synaptic package manage in ubuntu.