I am trying to write a simple loop in python that can turn of and on your tv using CEC control. But, whenever I try to "import cec" into my program it doesn't work. I am new to programing and I don't really know where to start.
looking at the error, it looks like you didn't install it. so, using your terminal in your editor, paste or type
pip install pyCEC
you can check the website here
and if it didn't work restart you editor.
then it will work perfectly.
It looks like cec is a python package: https://pypi.org/project/cec/
Depending on your python installation, you can likely install it with pip install cec.
See this documentation on getting started with python packages for more:
https://packaging.python.org/tutorials/installing-packages/
Related
Please excuse my lack of knowledge and poor terminology.
I am trying to get python-socketio-client running on my PI3B. It is used by some python code, not written by me, that takes selected data from Volumio3.x's API (under Buster), and passes it to my audio preamp controller to display it. The current Artist and Song Title.
It all worked on my PI2B with a version of Volumio 2.x under Jessie.
All my attempts to install python-socketio-client have errored.
I was wondering if I should install it with python3, and if so how?
Thanks
To install python packages usually you have to run pip install -m package-name
For Volumio if you check documentation (pyvolumio package) is this the one you are trying to use?
Only Python 3.7 and above are supported.
As you can see in: https://pypi.org/project/pyvolumio/
I have a programming book that i use to progress in python and it's really good. However, there is one module in the book that i can't install. I have tried everything. I tried pip install, i tried to contact the author of the book. I also tried to install it from PyPip, but notthing seem to work. I need to install the module to begin with 3d grapichs and start understanding how it works. I know i could use Numpy, but the book only shows this module and therfore i need to install it. Can someone help me install the GameObjects module?
You should be able to clone a Python3 version from https://github.com/timrprobocom/gameobjects . At least, all the tests pass.
everyone. I installed anaconda to use python and install ai packages. I am new to high-level computer use beyond the normal GUI that windows has blessed us with.
Background: I am just starting using command prompts and am teaching myself python to use for ai with keras and tensorflow. Unfortunately, I cannot get far enough to install these packages because after I install anaconda, I get multiple errors in the command prompt. Access Denied was solved by installing for all users and running as administrator. However, I cannot use conda, and when I use pip, I get constant html errors. Nothing works. I tried adding \Anaconda3 and \Anaconda3\Scripts to PATH, but it doesn't change anything. The prompt starts by telling me that it cannot find the specified paths then kicks me over to C:\Windows\system32, but when I cd back to my \Anaconda3 directory, nothing changes. What am I doing wrong? What do I need to try?
I appreciate it. As basic as this is, rest assured I spent days struggling with this before posting.
I'm a complete beginner in Python programming. I have trouble installing/importing the module 'requests' on python. When I use my command terminal to install requests, I get a message that requests is already installed. However, when I try to import requests into the file I'm working on, python tells me there is no such module installed.
Sorry to bother you with this silly and probably easy question, thanks in advance!
If you use PyCharm (which is a great choice in my opinion), go to the tab Run and select Edit Configuration and in the window that just opened make sure the your Python interpreter is the one you used when you pip installed the package you asked about.
You can check your Python version or just see in PyCharm if the requests is actually installed by going to the tab File, select Settings, click on Project: name_of_your_project and finally check in Project Interpreter that the package is installed.
First of all, I should say, that I checked all links at stackoverflow, but I still can't make it work. What I want is just as simple as my nose - I want to import numpy and I want to import modules created by f2py. Now, when I do in console
$ python
>> import numpy
I get an error No module named numpy. In the same way I get an error, when I try to import a fortran module made by f2py:
>> import testmodule
My OS is Ubuntu 12.04. I should also add, that I tried to uninstall and reinstall python hundreds of times with different libs and of course I did sudo apt-get install python-numpy etc. But that didn't help. What I want to hear from you, guys, is a complete step-by-step instruction (including unintallation of the current versions of python which may be corrupt and including installation instructions - download this version, unpack it to here etc.) I guess that instruction will be extremely worthy and usefull for python newbeis like me. The problem that I face now seems to be the simplest in the world, but I wonder why it has no simple solution.
Does your Python prompt have >> as the prompt? I've always seen >>> from Python.
If uninstalling Python and reinstalling doesn't work, perhaps the problem is with your user account? I'd try:
Create a new user, sudo useradd joe
Log in as the new user sudo -u joe bash -login
See if Python and numpy work now.
Exit from joe's shell (exit, logout or ^D).
Get rid of joe, sudo userdel joe
Now at least you know if the problem is with your system setup or your user setup.
Other things to look for:
run pip freeze | grep numpy or pip freeze | less to see which numpy package is (or isn't) installed.
Do you have something odd in your environment? Try env | grep -i python to see if you have a nonstandard environment variable.
Do you have python aliased to something else in your .profile or other startup? Try alias python to see if you really are starting python when you run python.
Do you have some old python in your $PATH? You can try which python and you should see /usr/bin/python. If you get '/usr/local/bin/pythonthat should be a link pointing to the "real" python at/usr/bin/python`.
Have a look at /usr/bin/python. It should be a link to python2.7.
During your uninstall-reinstall cycles, you can run pip freeze to see the list of installed packages. You should be able to make numpy appear and disappear in the freeze list when you install and uninstall it.