I am trying to run my python script in Debian but I keep getting the following error:
traceback (most recent call last):
File "gluon/contrib/websocket_messaging.py", Line 96, in <module>
import gluon.utils
ImportError: No module named utils
I've tried:
pip install gluon
Still didn't work. I also tried:
sudo apt-get update
sudo apt-get install python-gluon
but got
Unable to locate package python-gluon
Any help would be appreciated thank you
sudo apt-get update
sudo apt-get install python3-gluon
OR
pip3 install gluon
Related
I'm using Ubuntu 16.04. I tried to add a repo using terminal. While adding that, I got an error :
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 11, in <module>
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
I tried installing that module using various commands like :
pip3 install apt_pkg
sudo apt-get install --reinstall python3-apt
sudo apt-get install python3-apt --reinstall
Then if I tried to add that repo, the same error appeared.
The python versions I have is :
$ python3 --version
Python 3.7.9
$ python --version
Python 2.7.12
These are the versions I have in terminal. In IDLE, I have 3.5
What else shall I do to install that package apt_pkg???
I have a PC running Ubuntu 17.10. I want to runn a python script that uses gtk. HoweverI get the following error:
Traceback (most recent call last):
File "/usr/local/bin/selectvm.py", line 3, in <module>
import gtk
ImportError: No module named gtk
I have tried already many things like:
sudo apt install python-gtk2
sudo apt install python-gtk2-dev
but none of them works. APT says they are already installed.
Try:
sudo apt-get install python-gtk2
These are the python bindings for GTK.
Graphic package nessesary to build the software-center UI.
Or:
sudo apt-get install afnix
credits
Traceback (most recent call last):
File "C:\AppServ\www\pythonWeb\MySqlConn.py", line 1, in <module>
import mysql.connector
ImportError: No module named 'mysql'
I got the above error message while trying to import mysql.connector
I'm using a Window with python 3.4.2 and Appserv 2.5.10 for Window
I've saved the python file under the folder of AppServ.
Please help.
Error clearly shows you do 'not have the module "Mysql" which you are importing in order to process further.
ImportError: No module named 'mysql'
What you can do depending on OS you are using :
Windows
pip install mysqlclient
If you need 1.2.x versions (legacy Python only), use pip install MySQL-python
Note: Some dependencies might have to be in place when running the above command.
Ubuntu 14, Ubuntu 16, Debian 8.6 (jessie)
sudo apt-get install python-pip python-dev libmysqlclient-dev
Fedora 24:
sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc
Mac OS
brew install mysql-connector-c
if that fails, try
brew install mysql
once you install the module successfully re-run your script and it should work
I installed tkinter from yum,but I can only use it in Python2.
This is in Python3:
>>> import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/tkinter/__init__.py", line 38, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named '_tkinter'
and I can use "import Tkinter" in python2.
But how i can use it in Python3, Thanks.
Install python3:
sudo apt-get update
sudo apt-get install python3.5
If you have already done that, ge the setuptools:
sudo apt-get install python3-setuptools
sudo apt-get upgrade python3-setuptools
After which install tkinter:
sudo -H pip3 install tkinter
pip is not working in my python3.4
$ pip install django
Traceback (most recent call last):
File "usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named 'pkg_resources'
$ pip
Traceback (most recent call last):
File "usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named 'pkg_resources'
How do I fix this? What's the problem? Thanks
i just ran into the same error, here is what i've done to fix it:
sudo apt-get remove --purge python-pkg-resources
sudo apt-get install ubuntu-desktop
Try >sudo pip install django< I think that ought to do it
well then I suspect your pip is messed up so try
sudo apt-get install --reinstall python-pkg-resources
however if you are using Python 3 you may need to adjust to insure that you get the Python 3 environment set up rather than the P2 default
see here for more on that
How to use pip with Python 3.x alongside Python 2.x