Cannot import livestreamer module in python - python

I am new to python and just tried to import the live streamer module (http://livestreamer.readthedocs.org/en/latest/api.html) in Python.
The module is installed at:
/Library/Python/2.7/site-packages/livestreamer-1.8.0-py2.7.egg
My script is pretty much one line:
from livestreamer import Livestreamer
Error:
ImportError: cannot import name Livestreamer
I searched the web for similar issues, but couldn't find any related to this module, but apparently it's a circular dependent import...? I don't know how to fix this.
Note: My script works when it's just:
import livestreamer
I'd say the modules doesn't contain a class called Livestreamer, but the documentation says so.

Did you properly installed Livestreamer.? R u experienced any error ..?
Try running this command from the package
pip install setup.py

Related

import rpy2 but can not import rpy2.robjects when changing start folders

The Current problem I am looking into is described below:
My computer is Win10, I installed only one anaconda 3.5.3 on it. Using where python there is only one python in my computer.
I downloaded a rpy2python wheel file from the uefi website, and install that using pip install.
When I import rpy2 in C disk, it is already fine, import rpy2,import rpy2.robjects are all OK.
But when I import rpy2 in my own project, I can only first import rpy2, when I import rpy2.robjects,the program says can not find rpy2 module.
Finally I found the problem is that in my project, I occasionaly established an rpy2.py file, when I first import rpy2, it where automatically create an rpy2.pycache folder, secondly when I import rpy2.robjects, Of Course the computer can not find an rpy2.robjects.
Just Keep a track of my problem.
You'll want to check the Python documentation about import rules for modules. By default, having a file called rpy2.py in the working directory for your Python code will cause import rpy2 to find this one rather that the rpy2 package.
The easiest fix is probably to rename your module rpy2.py into something else.

Module importation error on Python 3.8.3; No module named 'tensorflow_docs'

I have been trying for fews days to follow this deep learning tutorial, https://www.tensorflow.org/tutorials/keras/regression
But I can't find a way to import tensorflow_docs, I did try this
https://stackoverflow.com/questions/55535518/modulenotfounderror-no-module-named-tensorflow-docs-when-creating-tensorflow
pip install git+https://github.com/tensorflow/docs
But I still get this error
ModuleNotFoundError: No module named 'tensorflow_docs'
I am running Python 3.8.3, through Pycharm.
Thank for your help.
tensorflow_docs was indeed in my computer but python was not looking at the directory,
I simply add
import sys sys.path.append("C:/users/xxxx/appdata/local/programs/python/python38/lib/site-packages")

Downloaded package ImportError

I have recently installed python 2.17.14 to use a package which I installed in the command prompt with:
python -m pip install packageName
However, whenever I try to use it with a script provided by the package authors, I get Import Errors:
ImportError: cannot import X from YX
ImportError: attempted relative import with no known parent package.
I don't know what I'm doing wrong, as I am really new to Python. Does anyone have any ideas?
The package is called neurodesign and I downloaded the try out script from the official website "neuropowertools.org"
Best,
Max
In case anyone (who is also new to python^^) fails ridiculously at this task as well: I had to manually install all the modules used within this package for it to work as they weren't installed automatically.

ModuleNotFoundError: No module named 'speech_recognition'

I am using powershell and scoop, windows.
I already installed speech_recognition bucket but still showing the error.
Code:
import speech_recognition as sr
import time
import json
import requests
import thread
import subprocess
SPLUNK_URL = "https://localhost"
# Splunk http event collector token
hec_token = ""
The python interpreter shows a ModuleNotFoundError when it can't find the module being imported. For more information on how import works, click here.
Since you have installed latest python 3.7, and are working on a code snippet that was built 2 years ago, there is likely a case that the speech_recognition module might not be installed for your current python.
Before you try anything, execute
pip list
and see all the modules currently installed for your current python interpreter. If the speech_recognition module is not available in the list, then install it:
pip install SpeechRecognition
Also, if you are having multiple python versions installed on your system then make sure you use the pip installer of the python interpreter that you are using for your application. If you are using or like having multiple python versions, then I suggest you use a tool like pyenv.

Error while importing pyVim.connect

I am attempting to run the following code which I received from samples here
from __future__ import print_function
import atexit
from pyVim.connect import SmartConnectNoSSL, Disconnect
from pyVmomi import vim
from tools import cli
I am receiving the following error:
ModuleNotFoundError: No Module named 'pyVim.connect'
The packages in question are from here and were installed using:
pip install pyvmomi
Is there something wrong with how I am installing these packages?
Looks like the code was a bit old. Importing 'pyvim' instead of 'pyVim' worked, though it seems to be named 'pyVim' on the github.
It's possible that you need to reinstall pvmomi to force the re-install of additional files in the pyVim/ package dir:
pip3 install --force pyvmomi
I haven't figured out how or what causes this, but the issue seems to occur on case-insensitive macOS file systems.
Since it has different behavior than Linux and case-sensitive macOS, I use the following "hack" to make it compatible between systems:
try:
from pyVim.connect import SmartConnectNoSSL
except ImportError:
from pyvim.connect import SmartConnectNoSSL
PS: You can use diskutil info / on macOS to figure out if your file system is case-sensitive or not (Details in another StackExchange question)

Categories