Getting the following error: "EnvironmentError: Unable to find libfuse" - python

I'm trying to load test my MQTT network on a CentOS7 machine by using this repositorie on github. I executed the following commands to install the python-mosquitto dependency.
# yum install python-pip
# pip install mosquitto
Then I built and installed the setup.py file located in the repository file:
# python setup.py build
# python setup.py install
When trying to use the package, an error was thrown:
# malaria publish -P 2 -n 100 -H localhost -s 10
Error:
# malaria publish -P 2 -n 100 -H localhost -s 10malaria publish -P 2 -n 100 -H localhost -s 10
Traceback (most recent call last):
File "/usr/bin/malaria", line 5, in <module>
pkg_resources.run_script('mqtt-malaria==0.1-77-g7ae4c97', 'malaria')
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 540, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1455, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/lib/python2.7/site-packages/mqtt_malaria-0.1_77_g7ae4c97-py2.7.egg/EGG-INFO/scripts/malaria", line 30, in <module>
import beem.main
File "/usr/lib/python2.7/site-packages/mqtt_malaria-0.1_77_g7ae4c97-py2.7.egg/beem/main.py", line 34, in <module>
import beem.cmds
File "/usr/lib/python2.7/site-packages/mqtt_malaria-0.1_77_g7ae4c97-py2.7.egg/beem/cmds/__init__.py", line 2, in <module>
import beem.cmds.subscribe
File "/usr/lib/python2.7/site-packages/mqtt_malaria-0.1_77_g7ae4c97-py2.7.egg/beem/cmds/subscribe.py", line 34, in <module>
import beem.listen
File "/usr/lib/python2.7/site-packages/mqtt_malaria-0.1_77_g7ae4c97-py2.7.egg/beem/listen.py", line 40, in <module>
import fuse
File "build/bdist.linux-x86_64/egg/fuse.py", line 69, in <module>
EnvironmentError: Unable to find libfuse
Googling the error didn't provide me any answers. Did I do something wrong in the install process? I don't have much experience with the usage/building of cloned Github Repositories.

If running CentOS you may want to do "yum install fuse-python", which will install fuse-libs as dependencies. It worked for me after doing that.

The issues page on the repository (the issue right before the one you linked to) mentions exactly this problem.
The solution, as you've found is to install fusepy separately, either from your package manager or with pip install fusepy.

Related

About the error in the installation steps of readthedocs local server

I'm trying to install readthedocs on my local gitlab server and I'm following the guide in the link.
ReadThedocs Guide
Here's the python version and pip version I'm using;
Python3.9
Pip3.9
To run the virtual pip environment, I use the following command.
python3.9 -m venv tutorial-env # I completed the install process with this command.
source tutorial-env/bin/activate # with this command I access the virtual pip environment
my steps in the virtual pip environment;
I run this from the readthedocs installation steps.
(tutorial-env) [redhat#gitlab tutorial-env]$ pip install -r requirements.txt
And no error occurred.
(tutorial-env) [redhat#gitlab tutorial-env]$ python3.9 /home/redhat/readthedocs.org/manage.py migrate
Gave the following error message
[debug ] Using slumber v2. [readthedocs.api.v2.client] api_host=http://127.0.0.1:8000 username=test
Traceback (most recent call last):
File "/home/redhat/readthedocs.org/manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/home/redhat/tutorial-env/lib64/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/home/redhat/tutorial-env/lib64/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
django.setup()
File "/home/redhat/tutorial-env/lib64/python3.9/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/redhat/tutorial-env/lib64/python3.9/site-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "/home/redhat/readthedocs.org/readthedocs/core/apps.py", line 15, in ready
import readthedocs.core.signals # noqa
File "/home/redhat/readthedocs.org/readthedocs/core/signals.py", line 17, in <module>
from readthedocs.core.unresolver import unresolve
File "/home/redhat/readthedocs.org/readthedocs/core/unresolver.py", line 16, in <module>
#dataclass(slots=True)
TypeError: dataclass() got an unexpected keyword argument 'slots'
However, when I run the python manage.py migrate command in the pip virtual environment, I get the following error message and I can't complete the installation process. What exactly this problem points to?
Thank you for support.
I haven't tried any solutions because I don't understand what is causing the problem.
You are following an outdated and unofficial documentation of Read the Docs (https://read-the-docs.readthedocs.io/en/latest/install.html). The official guide is a lot more updated and uses Docker now, which is easier to setup. Please, read the official guide at https://docs.readthedocs.io/en/latest/development/install.html

pip error calling lsb_release when installing new package

I'm trying to configure 2 Ubuntu servers to use Python and Tensorflow for my project. I finished the 1st server, however, there are some very unusual and annoying errors with the 2nd one. This is the log when I run pip check on the 1st server:
~$: pip check
No broken requirements found.
And the error log on the 2nd one:
~$: pip check
No broken requirements found.
Traceback (most recent call last):
File "/home/mju-hpc-02/.local/bin/pip", line 11, in <module>
sys.exit(main())
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/__init__.py", line 233, in main
return command.main(cmd_args)
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/basecommand.py", line 251, in main
timeout=min(5, options.timeout)) as session:
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/download.py", line 329, in __init__
self.headers["User-Agent"] = user_agent()
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/_vendor/distro.py", line 1050, in <module>
_distro = LinuxDistribution()
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/_vendor/distro.py", line 594, in __init__
if include_lsb else {}
File "/home/mju-hpc-02/.local/lib/python3.5/site-
packages/pip/_vendor/distro.py", line 931, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero
exit status 1
This error also shows everytime I'm trying to install a new package with pip. Anyone faced similar problems with pip or having a way to diagnose the error?
EDIT 1:
As languitar suggestion, I ran lsb_release -a on both machines and this is the log on the 1st one:
~$: lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
2nd one:
~$: lsb_release -a
Traceback (most recent call last):
File "/usr/bin/lsb_release", line 25, in <module>
import lsb_release
ImportError: No module named 'lsb_release'
You did not mention your Python version(s) available on your system.
Not sure how this happen, but often 'lsb_version' is available to run on python v2 and others on v3.
Most likely you have a multiple python version on your host.
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero
exit status 1
Is, indeed, failing because the 'lsb_release' library called by '/usr/bin/lsb_release' is not available for your particular Python version.
Your first attempt to fix this is simple:
sudo apt install lsb-release
Note is '-' and not '_'
Try again, if keep failing try the following: Look for your Python version library on /usr/lib, and confirm that 'lsb_release.py' is not there. Then, link the shared version to your library:
ln -sfv /usr/share/pyshared/lsb_release.py /usr/lib/python3.7/site-packages/lsb_release.py
Last resource, search /usr for any lsb_release.py and link it to your Python library.
find /usr -name lsb_release.py
You can just use default lsb_release or perhaps a bit modified version:
1 #!/bin/bash
171 [ -z "$LSB_VERSION" ] && LSB_VERSION="1.4"
172 #$MSG_NA
It seems your lsb_release binary is broken. Try to reinstall lsb-release (ubuntu or debian package).

Installing pip for arcpy

I'm attempting to install pip for arcpy (arcgis 10.2 on windows 7). Running get-pip.py results in the following error message:
X:\python>python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 20061, in <module>
main()
File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip
File "c:\temp\tmpou5fje\pip.zip\pip\__init__.py", line 26, in <module>
File "c:\temp\tmpou5fje\pip.zip\pip\utils\__init__.py", line 27, in <module>
File "c:\temp\tmpou5fje\pip.zip\pip\_vendor\pkg_resources\__init__.py", line 73, in <module>
File "c:\temp\tmpou5fje\pip.zip\pip\_vendor\packaging\specifiers.py", line 275, in <module>
File "c:\temp\tmpou5fje\pip.zip\pip\_vendor\packaging\specifiers.py", line 373, in Specifier
File "C:\Python27\ArcGIS10.2\Lib\re.py", line 190, in compile
return _compile(pattern, flags)
File "C:\Python27\ArcGIS10.2\Lib\re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: nothing to repeat
Using an administrator command prompt doesn't help. My real goal is to get win32com working under arcpy. I usual just copy the appropriate directories out of c:\python27\lib\site-packages to c:\python27\arcgis10.2\lib\site-packages to install a package under arcpy (why doesn't arcpy come with pip?) but that's not working for win32com, presumably do to a missing dll or other windows specific file.
I would recommend the following:
Get the setuptools module
Get the pip module`
And then run the following in command line (assuming windows)
path-to-python path-to-setuptools install
path-to-python path-to-pip install
I work on a closed network (away from the interwebs of old) and cannot use get-pip.py so I find it best to simply download the actual modules and hard install.
Keep us posted!
Copy get_pip.py to "C:\Python27\ArcGIS10.2", then perform command "python get-pip.py" in the directory.
Note that keep network connected in the process, so that auto-download and setup setuptools,wheels,etc.
Hope that can help you.
Try opening a CMD prompt and typing:
C:\Python27\ArcGIS10.2\python.exe -m pip install -U pip

unable to run scrapy in ec2

I'm trying to run a code on an ec2 server.
It is a python scrapy project which is executed fine on my own pc.
when trying to run it in the ec2 i get this:
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 4, in <module>
execute()
File "/usr/local/lib/python2.7/site-packages/scrapy/cmdline.py", line 122, in execute
cmds = _get_commands_dict(settings, inproject)
File "/usr/local/lib/python2.7/site-packages/scrapy/cmdline.py", line 46, in _get_commands_dict
cmds = _get_commands_from_module('scrapy.commands', inproject)
File "/usr/local/lib/python2.7/site-packages/scrapy/cmdline.py", line 29, in _get_commands_from_module
for cmd in _iter_command_classes(module):
File "/usr/local/lib/python2.7/site-packages/scrapy/cmdline.py", line 20, in _iter_command_classes
for module in walk_modules(module_name):
File "/usr/local/lib/python2.7/site-packages/scrapy/utils/misc.py", line 68, in walk_modules
submod = import_module(fullpath)
File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/site-packages/scrapy/commands/bench.py", line 3, in <module>
from scrapy.tests.mockserver import MockServer
File "/usr/local/lib/python2.7/site-packages/scrapy/tests/mockserver.py", line 6, in <module>
from twisted.internet import reactor, defer, ssl
File "/usr/local/lib/python2.7/site-packages/twisted/internet/ssl.py", line 59, in <module>
from OpenSSL import SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/usr/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 4, in <module>
binding = Binding()
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 87, in __init__
self._ensure_ffi_initialized()
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 106, in _ensure_ffi_initialized
libraries=libraries,
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/utils.py", line 39, in build_ffi
ffi = cffi.FFI()
File "/usr/local/lib/python2.7/site-packages/cffi/api.py", line 56, in __init__
**import _cffi_backend as backend
ImportError: libffi.so.5: cannot open shared object file: No such file or directory**
I've tried to update && reinstall all the mentioned libraries.
it always says it is most updated version.
this is my linux distro and default python is 2.7:
# cat /etc/*-release
NAME="Amazon Linux AMI"
VERSION="2015.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2015.03"
PRETTY_NAME="Amazon Linux AMI 2015.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2015.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2015.03
UPDATE: it looks like some sort of problem in scrapy dependencies.
trying
pip install scrapy
gave me the following error:
creating /usr/lib/python2.6/dist-packages/cssselect
error: could not create '/usr/lib/python2.6/dist-packages/cssselect': Permission denied
----------------------------------------
Command "/usr/bin/python2.6 -c "import setuptools,
tokenize;__file__='/tmp/pip-build- aoghBl/cssselect/setup.py'
;exec(compile(getattr(tokenize, 'open', open)
(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-1Qpx2a-record/install-record.txt
--single-version-externally-managed --compile"
failed with error code 1 in /tmp/pip-build-aoghBl/cssselect
Your updated question is a permissions error. you likely need to run
sudo pip install cssselect
May need to do that for other dependancies. It's strange though that it's trying to install under python2.6...
Edit:
Given that it's trying to run under 2.6, something is wrong with your instance. I'd suggest terminating and recreating the instance. The following commands are what I ran to get scrapy dependancies and my project up and running
sudo su
yum groupinstall 'Development Tools'
yum install -y libffi-devel libxslt-devel libxml2-devel openssl-devel python-devel mysql-devel
I also had problems getting scrapy installed. I found the following pages helpful:
How to Install Scrapy in Linux with out Any Errors
Installing Scrapy on an Amazon CentOS AMI
In the end, I had to launch a "fresh" Amazon Linux instance, which successfully installed with instructions from those pages. My older instance had too many issues to resolve.

Why can't I install the openstack nova client on OS X?

I am attempting to install the openstack nova client on my Mac (10.4.8)
nova = https://github.com/openstack/python-novaclient#command-line-api
python --version
Python 2.7.2
I successfully got nova installed (after installing pip)
When I run the client, I get the following error
foo#bar-macbook-pro:~$ nova
Traceback (most recent call last):
File "/usr/local/bin/nova", line 6, in <module>
from novaclient.shell import main
File "/Library/Python/2.7/site-packages/novaclient/__init__.py", line 15, in <module>
import pbr.version
ImportError: No module named pbr.version
In my research, I have found conflicting information about pbr, some say it is required for nova, while others say it isn't required for nova.
https://github.com/rackspace/pyrax/issues/121
When I attempt to install pbr, I see the following error.
foo#bar-macbook-pro:~$ sudo python ~/Downloads/pbr/setup.py install
Traceback (most recent call last):
File "setup.py", line 22, in <module>
**util.cfg_to_args())
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/util.py", line 241, in cfg_to_args
pbr.hooks.setup_hook(config)
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/__init__.py", line 27, in setup_hook
metadata_config.run()
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/base.py", line 29, in run
self.hook()
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/metadata.py", line 28, in hook
self.config['name'], self.config.get('version', None))
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/packaging.py", line 817, in get_version
version = _get_version_from_git(pre_version)
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/packaging.py", line 776, in _get_version_from_git
"git --git-dir=\"" + git_dir + "\" describe --always").replace(
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/packaging.py", line 220, in _run_shell_command
stderr=err_location)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
TypeError: must be encoded string without NULL bytes, not str
Is there anything apparent that would explain why I can not get the library installed?
Surely I must not be the first person to try and install nova on OS X.
Over a year later, I finally got this working on OS X Yosemite
sudo pip install python-novaclient
I did not have to install pbr.
I did the install based on venv:
virtualenv venv_name
source venv_name/bin/activate
pip install python-novaclient fabric
In my case, I had a mixup in which python I was using by way of fabric being installed globally.
Prior: rf -rf all my virtualenvs, rf -rf all references to novaclient (locally, and globally), and deleted a global install of fabric which was calling the novaclient.
Also as a precaution, I do not install pip globally, and only use it without sudo in virtualenvs.

Categories

Resources