Cannot import gtk in pycharm - python

I'm using pycharm. I got one project and I have a problem to run it.
I got errmsg :
ModuleNotFoundError: No module named 'pygtk'
In Pycharm I'm using python3 but I tried also on python2.
Without Pycharm in windows, I have the same problem.
Have someone solution to run scripts with gtk on Python3? It's even possible? I read that the gtk is no more supported, but I can't change a project.
Also, I tried to install pyGObject, but it's a problem with:
ModuleNotFoundError: No module named 'cairo'
The other posts found on SO doesn't work for me.
First lines in the code:
import pygtk, gtk
import numpy as np
import csv
....

Related

VSC does not import installed python libraries

I recently got a new computer and installed VSC as well as the official python on it. I installed some extra libraries for python on it with pip but whenever I want to run a script it gives me the error: ModuleNotFoundError: No module named 'numpy', or any other library installed afterwards. The libraries that come with python do work.
When I run the same script in IDLE for example, all the libraries are found and it works fine, but I would like to be able to code in VSC.
For example:
import numpy as np
import pygame as pg
import time
Rest of the code...
The error occurs right when it tries to import the libraries.
Any ideas on what might be causing the problem?

ipython import modules fine but python import fails

there.
I'm not quite sure what I have done recently that cause the problem as mentioned in the title. I usually run the simple code in ipython, and run longer scripts use python command. However, just now it seems that python somescript.py doesn't work well if some modules are imported in the somescript.py file. For example, say it contains import matplotlib.pyplot as plt, when I run python somescript.py in the terminal, I will get an error message:
ImportError: no module named matplotlib. This is weird since when I run import matplotlib.pyplot as plt under ipython, it works fine, no error.
And I checked that the python version and path is different from ipython. ipython has several more paths that python, and the version is 2.7.11, while python is 2.7.10. So, what should I do to permanently resolve this issue? Add the other paths to python? How can I make sure that they import the same modules each time? Thanks a lot.

Import Error: DLL load failed: The specified module could not be found

I want to use PyGtk to write GUI-based application. I have installed all the required dependencies mentioned on the site PyGTK. I didn't use the all-in-one installer but instead installed all the things I need manually.
When i run the interactive mode to test the installation result, I typed in
import pygtk
import gtk
The import gtk gives me the error mentioned above. More specifically, it says
File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 40, in <module>
from gtk import _gtk
However, it seems that there is only problems when importing gtk but this is exactly what I need.Things work fine if i do import pango something like that.
I am so frustrated but can not find a solution.
I have already installed Gtk+ from the Gtk website and add the bin file to the system PATH.
BTW, I use windows 7 and it's 32 bit python that i installed.
Anyone can help? Thank you

Cannot import livestreamer module in 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

ImportError: No module named pyfftw

Im using Ubuntu 13.10 with python 2.7. When running code i get this error. I installed FFTW and not sure why I am getting this error. Here is my code:
import math
from gnuradio import gr
import numpy
import scipy.signal
import pyfftw
this is where I get the error. Any help would be great. Thanks
Check the sys.path in python. That tells you the module search path. If it is not in there, and not in the %PYTHONPATH% path (which should be in sys.path also) then it should not be able to find it. If you install a module, the interpreter still needs to know where to look for it, if it's not in the default search location.

Categories