This question already has answers here:
Cannot install Matplotlib on Python 3.10
(2 answers)
Closed 1 year ago.
Im having a lot of difficulty installing matplotlib for python 3.10.0 on my new windows 11 machine. I will explain from the top down
In my VScode jupyter file I try to run the folowing code cell
import matplotlib
ModuleNotFoundError: No module named 'matplotlib'
I hop over to my cmd and run the folowing lines:
pip install --upgrade pip
Requirement already satisfied: pip in c:\users\robbe\appdata\local\programs\python\python310\lib\site-packages
pip install wheel
Requirement already satisfied: wheel in c:\users\robbe\appdata\local\programs\python\python310\lib\site-packages
pip install matplotlib
Collecting matplotlib
Using cached matplotlib-3.4.3.tar.gz (37.9 MB)
Preparing metadata (setup.py) ... done
all these requirements were satisfies
Building wheels for collected packages: matplotlib
Building wheel for matplotlib (setup.py) ... error
and now I get a huge error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\robbe\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\robbe\AppData\Local\Temp\pip-install-i7jkrq6p\matplotlib_45378a3fc28d4ce6bb53fd38cb01c06b\setup.py'"'"'; file='"'"'C:\Users\robbe\AppData\Local\Temp\pip-install-i7jkrq6p\matplotlib_45378a3fc28d4ce6bb53fd38cb01c06b\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\robbe\AppData\Local\Temp\pip-wheel-_bz0a7px'
cwd: C:\Users\robbe\AppData\Local\Temp\pip-install-i7jkrq6p\matplotlib_45378a3fc28d4ce6bb53fd38cb01c06b
Complete output (553 lines):
folowed by another error
ERROR: Failed building wheel for matplotlib
Running setup.py clean for matplotlib
Failed to build matplotlib
Installing collected packages: matplotlib
Running setup.py install for matplotlib ... error
Can someone help explain to me whats wrong here? I've tried almost every solution I could find on here (such as specifying a differet matplotlib build to install or running the line pip install --upgrade matplotlib) but I can't get it fixed
:( I just want to make some graphs
Sorry you guys, I've used this line
pip install matplotlib==3.5.0rc1
And this versions of matplotlib did work!!!! :)
Related
according the following paragraph Vectorized Environment,
i wanted to install library baselines, first time it told me that i should install mujoco, i have searched across internet information about this library and found that i could install it using following command
pip install free-mujoco-py
but i got following errors :
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source
of the following dependency conflicts.
yellowbrick 1.3.post1 requires numpy<1.20,>=1.16.0, but you have numpy 1.22.1 which is incompatible.
tensorflow 2.6.0 requires numpy~=1.19.2, but you have numpy 1.22.1 which is incompatible.
actually mujoco-py is installed i can call it using
import mujoco_py
but when i have tried
pip install baselines
i got :
Building wheel for mujoco-py (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\User\PycharmProjects\MachineLearning\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys
.argv[0] = '"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-gibatj1_\\mujoco-py_ec86452e9e9f4ec2b2c6293e0dac635a\\setup.py'"'"';
__file__='"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-gibatj1_\\mujoco-py_ec86452e9e9f4ec2b2c6293e0dac635a\\setup.py'"'"';f =
getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup
()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d '
C:\Users\User\AppData\Local\Temp\pip-wheel-f0q_yw3t'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-gibatj1_\mujoco-py_ec86452e9e9f4ec2b2c6293e0dac635a\
Complete output (54 lines):
running bdist_wheel
running build
You appear to be missing MuJoCo. We expected to find the file here: C:\Users\User\.mujoco\mjpro150
This package only provides python bindings, the library must be installed separately.
what happens? please help me
i think that the problem is about the version of numpy
pip install numpy==1.19.2
Can solve your problem about your installation problem
I was trying to install guidedlda on google colab notebook but it keeps giving me errors the following code i have used so far.
!pip install guidedlda
pip install guidedlda
https://github.com/vi3k6i5/GuidedLDA
cd GuidedLDA
sh build_dist.sh
python setup.py sdist
pip install -e
I kept getting the following error. If someone knows how to fix this on google colab please let me know
Collecting guidedlda Using cached
https://files.pythonhosted.org/packages/f8/ee/6d6e2b3525388399e12a4482554c7529a5fcf5e99c50a60abaa02894b8bf/guidedlda-2.0.0.dev22.tar.gz
Requirement already satisfied: numpy in
/usr/local/lib/python3.7/dist-packages (from guidedlda) (1.19.5)
Building wheels for collected packages: guidedlda Building wheel for
guidedlda (setup.py) ... error ERROR: Failed building wheel for
guidedlda Running setup.py clean for guidedlda Failed to build
guidedlda Installing collected packages: guidedlda
Running setup.py install for guidedlda ... error ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys,
setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-1u3r_cht/guidedlda/setup.py'"'"';
file='"'"'/tmp/pip-install-1u3r_cht/guidedlda/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
install --record /tmp/pip-record-wpryz4pa/install-record.txt
--single-version-externally-managed --compile Check the logs for full command output.
You probably saw this, but just in case : https://guidedlda.readthedocs.io/en/latest/
If pip install doesn’t work then try the next step.
https://github.com/vi3k6i5/GuidedLDA
cd GuidedLDA
sh build_dist.sh
python setup.py sdist
pip install -e .
I am trying install geopandas. I have using codes I can't find but i keep getting error messages. I have geopy already installed but can't install geopandas.
Result i had when running installation with anaconda prompt:
I had also tried installation using %pip install geopandas --user
Collecting geopandas
Using cached geopandas-0.8.1-py2.py3-none-any.whl (962 kB)
Collecting pyproj>=2.2.0
Using cached pyproj-2.6.1.post1-cp38-cp38-win32.whl (15.7 MB)
Collecting shapely
Using cached Shapely-1.7.1-cp38-cp38-win32.whl (894 kB)
Requirement already satisfied: pandas>=0.23.0 in c:\users\fejiro\anaconda3\lib\site-packages (from geopandas) (1.0.5)
Collecting fiona
Using cached Fiona-1.8.17.tar.gz (1.3 MB)
Note: you may need to restart the kernel to use updated packages.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\fejiro\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\fejiro\\AppData\\Local\\Temp\\pip-install-q86d5ghj\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\fejiro\\AppData\\Local\\Temp\\pip-install-q86d5ghj\\fiona\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\fejiro\AppData\Local\Temp\pip-pip-egg-info-64u_nnsk'
cwd: C:\Users\fejiro\AppData\Local\Temp\pip-install-q86d5ghj\fiona\
Complete output (1 lines):
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can someone tell what to do?
It s better to use Anaconda distribution for more complex packages. Use install anaconda and then create an environment for the project. After that, you could use conda-forge to take care of all the compatibility problems
I tried to install a package folium into Jupyter Notebook. I had to try many methods, such as add system path, upgrade pip, install setuptools but I cannot make it. My laptop is Macbook Pro, system: Catalina 10.15.3, Jupyter Notebook from Anaconda. Python version: 3.7.4
System.exectutable:
'/opt/anaconda3/bin/python'
System path:
['/Users/scott/Documents/Untitled Folder',
'/opt/anaconda3/lib/python37.zip',
'/opt/anaconda3/lib/python3.7',
'/opt/anaconda3/lib/python3.7/lib-dynload',
'',
'/opt/anaconda3/lib/python3.7/site-packages',
'/opt/anaconda3/lib/python3.7/site-packages/aeosa',
'/opt/anaconda3/lib/python3.7/site-packages/IPython/extensions',
'/Users/scott/.ipython']
The code I wrote is:
import numpy as np
import pandas as pd
import collections
import re
import matplotlib.pyplot as plt
import matplotlib
from collections import OrderedDict
from math import ceil
#!python3 -m pip install folium --user
#!python3 -m pip install branca --user
#!python3 -m pip install jinja2 --user
#!python3 -m pip install requests --user
#!pip install --user scipy
#!python -m pip install --upgrade pip
import scipy
#import branca
! pip install --user folium
import tqdm
import folium
However, I got such error:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting folium
Using cached folium-0.8.3-py2.py3-none-any.whl (87 kB)
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from folium) (1.12.0)
Collecting jinja2
Using cached Jinja2-2.11.1-py2.py3-none-any.whl (126 kB)
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from folium) (1.8.0rc1)
Collecting requests
Using cached requests-2.23.0-py2.py3-none-any.whl (58 kB)
Collecting branca>=0.3.0
Using cached branca-0.4.0.tar.gz (41 kB)
ERROR: Command errored out with exit status 1:
command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zm/pks1_crj5d7d7wp4x_4sr5rm0000gn/T/pip-install-r8yciP/branca/setup.py'"'"'; __file__='"'"'/private/var/folders/zm/pks1_crj5d7d7wp4x_4sr5rm0000gn/T/pip-install-r8yciP/branca/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/zm/pks1_crj5d7d7wp4x_4sr5rm0000gn/T/pip-install-r8yciP/branca/pip-egg-info
cwd: /private/var/folders/zm/pks1_crj5d7d7wp4x_4sr5rm0000gn/T/pip-install-r8yciP/branca/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/zm/pks1_crj5d7d7wp4x_4sr5rm0000gn/T/pip-install-r8yciP/branca/setup.py", line 41
print(error, file=sys.stderr) # noqa
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-201-2c07c456259d> in <module>
17 get_ipython().system(' pip install --user folium')
18 import tqdm
---> 19 import folium
ModuleNotFoundError: No module named 'folium'
I had confused with this error for days, could anyone help me? Thanks in advance!
Looks like you're trying to work in an anaconda 3.7 environment, but your error message is complaining about being python 2.7 and it's complaining it cannot find folium.
Did you somehow pip install the folium module while working outside your anaconda 3.7 environment?
Maybe you could try the conda navigator tool and grab the folium package that way...
$ pip install pyttsx3
Collecting pyttsx3
Using cached pyttsx3-2.80-py3-none-any.whl (39 kB)
Collecting pyobjc>=2.4
Using cached pyobjc-6.1-py3-none-any.whl (2.9 kB)
Collecting comtypes; "win32" in sys_platform
Using cached comtypes-1.1.7.zip (180 kB)
Collecting pyobjc-framework-SyncServices==6.1
Using cached pyobjc-framework-SyncServices-6.1.tar.gz (42 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\abrar\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Abrar\\AppData\\Local\\Temp\\pip-install-e8rlz1t4\\pyobjc-framework-SyncServices\\setup.py'"'"'; __file__='"'"'C:\\Users\\Abrar\\AppData\\Local\\Temp\\pip-install-e8rlz1t4\\pyobjc-framework-SyncServices\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Abrar\AppData\Local\Temp\pip-install-e8rlz1t4\pyobjc-framework-SyncServices\pip-egg-info'
l = plistlib.readPlist("/System/Library/CoreServices/SystemVersion.plist")
File "c:\users\abrar\appdata\local\programs\python\python3
i m trying this on python 3.7.3 and using latest pip version but i couldn't understand how to fix it
It's a bug in pyttsx3 2.80: https://github.com/nateshmbhat/pyttsx3/issues/82. No fix yet. Try downgrading to pyttsx3 2.71:
pip install -U pyttsx3==2.71
Try to run the following command
pip install git+git://github.com/nateshmbhat/pyttsx3.git
It worked for me
I got the above command from pyttsx3 github issues
If you are using Python 3.x, then you will be using PIP3. To install pyttsx3 for Python 3.x, you will have to use pip3.
If you are using Linux based OS, use the following command.
pip3 show pyttsx3
If you are using Windows,
pip3 install pywin32 pypiwin32 pyttsx3
This copied from Bhutan IO. They have shared interesting examples, in the link given below with YouTube tutorial too.
How to Install pyttsx 3 in Windows
First try installing wheel
pip install wheel
Then you can install pyttsx3, pip install pyttsx3, this should work for you.