I wrote a program in python 3.6.2(32 bit) in Windows, and imported the following libraries.
from tkinter import font
from fontTools.ttLib import TTFont
from tkinter import messagebox
import tkinter.font as font
from tkinter.ttk import Separator, Style
from tkinter.filedialog import *
import tkinter as tkfont
When I run the code, I get this error:
No module named 'fontTools'
When I install the module via this command:
pip install fontTools
I get the following error:
Could not find a version that satisfies the requirement fontTools (from versions: )
No matching distribution found for fontTools
How can I fix this?
As the documentation states:
pip install fonttools
It's all lowercase.
You can use following command as below:
pip install --user fonttools
Related
Getting ImportError: No module named speech_recognition,
Code Snippet:
# for speech-to-text
import speech_recognition as sr
# for text-to-speech
from gtts import gTTS
# for language model
import transformers
import os
import time
# for data
import os
import datetime
import numpy as np
I have already tried pip3 install SpeechRecognition and pip install SpeechRecognition
pip3 install SpeechRecognition
Requirement already satisfied: SpeechRecognition in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (3.8.1)
WARNING: You are using pip version 21.3.1; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
I am using Python 3.8
I have already installed "PySimpleGUI" library, but I can't import it. In my terminal window I typed:
pip install PySimpleGUI
And it worked, because I typed it again and received this message:
PS C:\Users\raulc\AMBIENTES> pip install PySimpleGUI
Requirement already satisfied: PySimpleGUI in c:\users\raulc\appdata\local\programs\python\python310\lib\site-packages (4.59.0)
However, I can't import it, that's what i get:
Import "PySimpleGUI" could not be resolved
I use Ubuntu. When I try to install tkinter it throws error
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
I saw that this error is beacuse I already have tkinter, but when I try to import it there is another error
ModuleNotFoundError: No module named 'tkinter'
This happens also when I use capital T (Tkinter).
For installing tkinter in Ubuntu I use the command:
sudo apt install python3-tk
I'm trying to import montage2d module from scikit-image:
from skimage.util.montage import montage2d
But this error popped up:
ModuleNotFoundError: No module named 'skimage.util.montage'
I'm pretty sure I installed the scikit-image package as:
pip install scikit-image (0.18.1)
I'm trying pip install scikit-image==0.13.1 but it failed
enter image description here
Try:
from skimage.util import montage
Or, with older versions:
pip install scikit-image==0.13.1
from skimage.util.montage import montage2d
The issue is in the title:
ImportError: cannot import name 'styles' from 'matplotlib'
I have tried the recommended answers, I have used
sudo pip install --upgrade matplotlib
and
pip install --user --upgrade matplotlib
and still have the same error as before.
Code:
import tkinter as tk
from tkinter import ttk
import matplotlib
from matplotlib import styles
LARGE_FONT = ("Verdana", 12)
error:
ImportError: cannot import name 'styles' from 'matplotlib'
(/Users/myname/opt/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py)
I have tried this with a few python versions in vs code (3.6.6, 3.7.6, 3.8.1) and Anaconda Spyder (which I believe is 3.7.x but I'm not sure which) and get the same error.
Any ideas or is Matplotlib styles not useable anymore?
Do you mean 'style' instead of 'styles'?
from matplotlib import style